Ticket #39552: 39552.2.patch
File 39552.2.patch, 813 bytes (added by , 8 years ago) |
---|
-
wp-includes/functions.php
2373 2373 } else { 2374 2374 $mime = false; 2375 2375 } 2376 if( ( $mime === 'application/octet-stream' || $mime === false ) && function_exists ( 'finfo_file' ) ){ 2377 /* if the mime type is false or octet stream, its possible we are dealing with an image file not supported by PHP Constants (this applies at least to svg, but might apply to other file types) 2378 to fix this, use finfo to determine the mimetype instead 2379 */ 2380 $finfo = finfo_open( FILEINFO_MIME_TYPE ); 2381 $mime = finfo_file( $finfo, $file ); 2382 finfo_close( $finfo ); 2383 } 2376 2384 } catch ( Exception $e ) { 2377 2385 $mime = false; 2378 2386 }