EZP-23390 - Legacy IO loads whole file to get mime type with FS cluster handler
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
This comment has been minimized.
andrerom commentedSep 28, 2014
Patch needs to be applied in ezpublish_legacy folder.