Make WordPress Core


Ignore:
Timestamp:
05/10/2022 05:00:15 AM (4 years ago)
Author:
peterwilsoncc
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r53317 r53372  
    35043504        }
    35053505
    3506         $size = (int) @filesize( $path );
     3506        $size = file_exists( $path ) ? (int) filesize( $path ) : 0;
    35073507
    35083508        /**
Note: See TracChangeset for help on using the changeset viewer.