Media: Remove error suppression in `wp_filesize()`.
Replace error suppressing in `wp_filesize()` with a `file_exists()` check before calling the native PHP `filesize()` function. Follow up to [52837]. Props Cybr, johnbillion, spacedmonkey, antpb, azouamauriac, ironprogrammer, mukesh27, costdev, audrasjb, dlh. Fixes #55678. See #49412. Built from https://develop.svn.wordpress.org/trunk@53372 git-svn-id: http://core.svn.wordpress.org/trunk@52961 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6aa2e2c123
commit
8545c4493b
|
@ -3503,7 +3503,7 @@ function wp_filesize( $path ) {
|
||||||
return $size;
|
return $size;
|
||||||
}
|
}
|
||||||
|
|
||||||
$size = (int) @filesize( $path );
|
$size = file_exists( $path ) ? (int) filesize( $path ) : 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filters the size of the file.
|
* Filters the size of the file.
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.1-alpha-53371';
|
$wp_version = '6.1-alpha-53372';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue