mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-06 13:29:35 +00:00
Media: Conditionally pass 2nd parameter to getimagesize()
.
In the wrapper function `wp_getimagesize()` check if the second parameter was passed before sending it to the PHP function `getimagesize()`. The PHP function has a different execution path depending on the number of parameters passed, this ensures the wrapper function follows the appropriate path. Follow up to [50552]. Props azaozz, hellofromtonya, Mista-Flo, peterwilsoncc, rinatkhaziev, RogerTheriault, SergeyBiryukov, terriann, whyisjake. Merges [50586] to the 5.7 branch. Fixes #52826. Built from https://develop.svn.wordpress.org/branches/5.7@50662 git-svn-id: http://core.svn.wordpress.org/branches/5.7@50274 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
894f140b12
commit
2c8182fcba
@ -4982,7 +4982,11 @@ function wp_getimagesize( $filename, array &$image_info = null ) {
|
||||
// Return without silencing errors when in debug mode.
|
||||
defined( 'WP_DEBUG' ) && WP_DEBUG
|
||||
) {
|
||||
return getimagesize( $filename, $image_info );
|
||||
if ( 2 === func_num_args() ) {
|
||||
return getimagesize( $filename, $image_info );
|
||||
} else {
|
||||
return getimagesize( $filename );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -4993,8 +4997,12 @@ function wp_getimagesize( $filename, array &$image_info = null ) {
|
||||
* even when it's able to provide image size information.
|
||||
*
|
||||
* See https://core.trac.wordpress.org/ticket/42480
|
||||
*
|
||||
* phpcs:ignore WordPress.PHP.NoSilencedErrors
|
||||
*/
|
||||
return @getimagesize( $filename, $image_info );
|
||||
if ( 2 === func_num_args() ) {
|
||||
// phpcs:ignore WordPress.PHP.NoSilencedErrors
|
||||
return @getimagesize( $filename, $image_info );
|
||||
} else {
|
||||
// phpcs:ignore WordPress.PHP.NoSilencedErrors
|
||||
return @getimagesize( $filename );
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.7.1-alpha-50661';
|
||||
$wp_version = '5.7.1-alpha-50662';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
x
Reference in New Issue
Block a user