mirror of
https://github.com/misterunknown/ifm.git
synced 2025-08-09 17:46:31 +02:00
Fixed javascript error when the mime_type of an item is not a string
This commit is contained in:
@@ -1572,10 +1572,12 @@ function IFM( params ) {
|
||||
} else if(
|
||||
self.config.edit &&
|
||||
(
|
||||
item.mime_type.substr( 0, 4 ) == "text"
|
||||
|| item.mime_type == "inode/x-empty"
|
||||
|| item.mime_type.indexOf( "xml" ) != -1
|
||||
|| item.mime_type.indexOf( "json" ) != -1
|
||||
typeof item.mime_type === "string" && (
|
||||
item.mime_type.substr( 0, 4 ) == "text"
|
||||
|| item.mime_type == "inode/x-empty"
|
||||
|| item.mime_type.indexOf( "xml" ) != -1
|
||||
|| item.mime_type.indexOf( "json" ) != -1
|
||||
)
|
||||
)
|
||||
) {
|
||||
item.eaction = "edit";
|
||||
|
10
ifm.php
10
ifm.php
@@ -1572,10 +1572,12 @@ function IFM( params ) {
|
||||
} else if(
|
||||
self.config.edit &&
|
||||
(
|
||||
item.mime_type.substr( 0, 4 ) == "text"
|
||||
|| item.mime_type == "inode/x-empty"
|
||||
|| item.mime_type.indexOf( "xml" ) != -1
|
||||
|| item.mime_type.indexOf( "json" ) != -1
|
||||
typeof item.mime_type === "string" && (
|
||||
item.mime_type.substr( 0, 4 ) == "text"
|
||||
|| item.mime_type == "inode/x-empty"
|
||||
|| item.mime_type.indexOf( "xml" ) != -1
|
||||
|| item.mime_type.indexOf( "json" ) != -1
|
||||
)
|
||||
)
|
||||
) {
|
||||
item.eaction = "edit";
|
||||
|
10
src/ifm.js
10
src/ifm.js
@@ -148,10 +148,12 @@ function IFM( params ) {
|
||||
} else if(
|
||||
self.config.edit &&
|
||||
(
|
||||
item.mime_type.substr( 0, 4 ) == "text"
|
||||
|| item.mime_type == "inode/x-empty"
|
||||
|| item.mime_type.indexOf( "xml" ) != -1
|
||||
|| item.mime_type.indexOf( "json" ) != -1
|
||||
typeof item.mime_type === "string" && (
|
||||
item.mime_type.substr( 0, 4 ) == "text"
|
||||
|| item.mime_type == "inode/x-empty"
|
||||
|| item.mime_type.indexOf( "xml" ) != -1
|
||||
|| item.mime_type.indexOf( "json" ) != -1
|
||||
)
|
||||
)
|
||||
) {
|
||||
item.eaction = "edit";
|
||||
|
Reference in New Issue
Block a user