Created
September 28, 2014 21:17
-
-
Save andrerom/17053187dbfea0a89806 to your computer and use it in GitHub Desktop.
EZP-23390 - Legacy IO loads whole file to get mime type with FS cluster handler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/kernel/classes/clusterfilehandlers/ezfsfilehandler.php b/kernel/classes/clusterfilehandlers/ezfsfilehandler.php | |
index 1689b96..25a153c 100644 | |
--- a/kernel/classes/clusterfilehandlers/ezfsfilehandler.php | |
+++ b/kernel/classes/clusterfilehandlers/ezfsfilehandler.php | |
@@ -117,7 +117,16 @@ class eZFSFileHandler implements eZClusterFileHandlerInterface | |
eZDebugSetting::writeDebug( 'kernel-clustering', ' clearstatcache called on ' . $this->filePath, __METHOD__ ); | |
} | |
- $this->metaData = file_exists( $this->filePath ) ? stat( $this->filePath ) : false; | |
+ if ( file_exists( $this->filePath ) ) | |
+ { | |
+ $this->metaData = stat( $this->filePath ); | |
+ $fileInfo = new finfo( FILEINFO_MIME_TYPE ); | |
+ $this->metaData['datatype'] = $fileInfo->file( $this->filePath ); | |
+ } | |
+ else | |
+ { | |
+ $this->metaData = false; | |
+ } | |
eZDebug::accumulatorStop( 'dbfile' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Patch needs to be applied in ezpublish_legacy folder.