mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@53372 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -3503,7 +3503,7 @@ function wp_filesize( $path ) {
|
||||
return $size;
|
||||
}
|
||||
|
||||
$size = (int) @filesize( $path );
|
||||
$size = file_exists( $path ) ? (int) filesize( $path ) : 0;
|
||||
|
||||
/**
|
||||
* Filters the size of the file.
|
||||
|
||||
Reference in New Issue
Block a user