Edit File by line
/home/barbar84/www/wp-inclu...
File: media.php
*
[5000] Fix | Delete
* @param string $filename The file path.
[5001] Fix | Delete
* @param array $image_info Optional. Extended image information (passed by reference).
[5002] Fix | Delete
* @return array|false Array of image information or false on failure.
[5003] Fix | Delete
*/
[5004] Fix | Delete
function wp_getimagesize( $filename, array &$image_info = null ) {
[5005] Fix | Delete
if (
[5006] Fix | Delete
// Skip when running unit tests.
[5007] Fix | Delete
! defined( 'WP_RUN_CORE_TESTS' )
[5008] Fix | Delete
&&
[5009] Fix | Delete
// Return without silencing errors when in debug mode.
[5010] Fix | Delete
defined( 'WP_DEBUG' ) && WP_DEBUG
[5011] Fix | Delete
) {
[5012] Fix | Delete
if ( 2 === func_num_args() ) {
[5013] Fix | Delete
return getimagesize( $filename, $image_info );
[5014] Fix | Delete
} else {
[5015] Fix | Delete
return getimagesize( $filename );
[5016] Fix | Delete
}
[5017] Fix | Delete
}
[5018] Fix | Delete
[5019] Fix | Delete
/*
[5020] Fix | Delete
* Silencing notice and warning is intentional.
[5021] Fix | Delete
*
[5022] Fix | Delete
* getimagesize() has a tendency to generate errors, such as
[5023] Fix | Delete
* "corrupt JPEG data: 7191 extraneous bytes before marker",
[5024] Fix | Delete
* even when it's able to provide image size information.
[5025] Fix | Delete
*
[5026] Fix | Delete
* See https://core.trac.wordpress.org/ticket/42480
[5027] Fix | Delete
*/
[5028] Fix | Delete
if ( 2 === func_num_args() ) {
[5029] Fix | Delete
// phpcs:ignore WordPress.PHP.NoSilencedErrors
[5030] Fix | Delete
return @getimagesize( $filename, $image_info );
[5031] Fix | Delete
} else {
[5032] Fix | Delete
// phpcs:ignore WordPress.PHP.NoSilencedErrors
[5033] Fix | Delete
return @getimagesize( $filename );
[5034] Fix | Delete
}
[5035] Fix | Delete
}
[5036] Fix | Delete
[5037] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function