1
0
mirror of https://github.com/misterunknown/ifm.git synced 2025-08-11 10:34:00 +02:00

Fixed javascript error when the mime_type of an item is not a string

This commit is contained in:
Marco Dickert
2018-03-26 10:37:39 +02:00
parent 1ec37792a0
commit 3117a15790
3 changed files with 18 additions and 12 deletions

View File

@@ -1572,10 +1572,12 @@ function IFM( params ) {
} else if( } else if(
self.config.edit && self.config.edit &&
( (
item.mime_type.substr( 0, 4 ) == "text" typeof item.mime_type === "string" && (
|| item.mime_type == "inode/x-empty" item.mime_type.substr( 0, 4 ) == "text"
|| item.mime_type.indexOf( "xml" ) != -1 || item.mime_type == "inode/x-empty"
|| item.mime_type.indexOf( "json" ) != -1 || item.mime_type.indexOf( "xml" ) != -1
|| item.mime_type.indexOf( "json" ) != -1
)
) )
) { ) {
item.eaction = "edit"; item.eaction = "edit";

10
ifm.php
View File

@@ -1572,10 +1572,12 @@ function IFM( params ) {
} else if( } else if(
self.config.edit && self.config.edit &&
( (
item.mime_type.substr( 0, 4 ) == "text" typeof item.mime_type === "string" && (
|| item.mime_type == "inode/x-empty" item.mime_type.substr( 0, 4 ) == "text"
|| item.mime_type.indexOf( "xml" ) != -1 || item.mime_type == "inode/x-empty"
|| item.mime_type.indexOf( "json" ) != -1 || item.mime_type.indexOf( "xml" ) != -1
|| item.mime_type.indexOf( "json" ) != -1
)
) )
) { ) {
item.eaction = "edit"; item.eaction = "edit";

View File

@@ -148,10 +148,12 @@ function IFM( params ) {
} else if( } else if(
self.config.edit && self.config.edit &&
( (
item.mime_type.substr( 0, 4 ) == "text" typeof item.mime_type === "string" && (
|| item.mime_type == "inode/x-empty" item.mime_type.substr( 0, 4 ) == "text"
|| item.mime_type.indexOf( "xml" ) != -1 || item.mime_type == "inode/x-empty"
|| item.mime_type.indexOf( "json" ) != -1 || item.mime_type.indexOf( "xml" ) != -1
|| item.mime_type.indexOf( "json" ) != -1
)
) )
) { ) {
item.eaction = "edit"; item.eaction = "edit";