Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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' );
}
}
@andrerom

This comment has been minimized.

Copy link
Owner Author

andrerom commented Sep 28, 2014

Patch needs to be applied in ezpublish_legacy folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.