+ if ( $ext === true ) {
+ $i = strrpos( $path, '.' );
+ $ext = strtolower( $i ? substr( $path, $i + 1 ) : '' );
+ }
+
+ # mime type according to file contents
+ $info['file-mime'] = $magic->guessMimeType( $path, false );
+ # logical mime type
+ $info['mime'] = $magic->improveTypeFromExtension( $info['file-mime'], $ext );
+