Ticket #11946: functions.php.reject.patch
File functions.php.reject.patch, 834 bytes (added by , 11 years ago) |
---|
-
functions.php
1894 1894 // We can't do any further validation without a file to work with 1895 1895 if ( ! file_exists( $file ) ) 1896 1896 return compact( 'ext', 'type', 'proper_filename' ); 1897 1898 // if php supports finfo check if the extension does matches the file's real type 1899 if (function_exists('finfo_file')) { 1900 $finfo = finfo_open(FILEINFO_MIME_TYPE); 1901 $mime = finfo_file($finfo, $file); 1902 finfo_close($finfo); 1897 1903 1904 // the extension does not match the file's real type 1905 if ($mime !== $type) { 1906 $type = $ext = false; 1907 } 1908 } 1909 1898 1910 // We're able to validate images using GD 1899 1911 if ( $type && 0 === strpos( $type, 'image/' ) && function_exists('getimagesize') ) { 1900 1912