Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/wp-admin/includes/file.php
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ function wp_handle_upload_error( &$file, $message ) {
return call_user_func_array( $upload_error_handler, array( &$file, __( 'Specified file failed upload test.' ) ) );
}

$test_file_size = 'wp_handle_upload' === $action ? $file['size'] : filesize( $file['tmp_name'] );
$test_file_size = 'wp_handle_upload' === $action ? $file['size'] : wp_filesize( $file['tmp_name'] );
// A non-empty file will pass this test.
if ( $test_size && ! ( $test_file_size > 0 ) ) {
if ( is_multisite() ) {
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/ms.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function check_upload_size( $file ) {

$space_left = get_upload_space_available();

$file_size = filesize( $file['tmp_name'] );
$file_size = wp_filesize( $file['tmp_name'] );
if ( $space_left < $file_size ) {
/* translators: %s: Required disk space in kilobytes. */
$file['error'] = sprintf( __( 'Not enough space to upload. %s KB needed.' ), number_format( ( $file_size - $space_left ) / KB_IN_BYTES ) );
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ function get_mu_plugins() {
$wp_plugins[ $plugin_file ] = $plugin_data;
}

if ( isset( $wp_plugins['index.php'] ) && filesize( WPMU_PLUGIN_DIR . '/index.php' ) <= 30 ) {
if ( isset( $wp_plugins['index.php'] ) && wp_filesize( WPMU_PLUGIN_DIR . '/index.php' ) <= 30 ) {
// Silence is golden.
unset( $wp_plugins['index.php'] );
}
Expand Down
4 changes: 2 additions & 2 deletions src/wp-admin/theme-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@
$content = '';
if ( ! empty( $posted_content ) ) {
$content = $posted_content;
} elseif ( ! $error && filesize( $file ) > 0 ) {
} elseif ( ! $error && wp_filesize( $file ) > 0 ) {
$f = fopen( $file, 'r' );
$content = fread( $f, filesize( $file ) );
$content = fread( $f, wp_filesize( $file ) );

if ( str_ends_with( $file, '.php' ) ) {
$functions = wp_doc_link_parse( $content );
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/class-wp-customize-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -6087,7 +6087,7 @@ public function export_header_video_settings( $response, $selective_refresh, $pa
public function _validate_header_video( $validity, $value ) {
$video = get_attached_file( absint( $value ) );
if ( $video ) {
$size = filesize( $video );
$size = wp_filesize( $video );
if ( $size > 8 * MB_IN_BYTES ) {
$validity->add(
'size_too_large',
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -8881,7 +8881,7 @@ function recurse_dirsize( $directory, $exclude = null, $max_execution_time = nul
$path = $directory . '/' . $file;
if ( '.' !== $file && '..' !== $file ) {
if ( is_file( $path ) ) {
$size += filesize( $path );
$size += wp_filesize( $path );
} elseif ( is_dir( $path ) ) {
$handlesize = recurse_dirsize( $path, $exclude, $max_execution_time, $directory_cache );
if ( $handlesize > 0 ) {
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/ms-files.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

header( 'Content-Type: ' . $mimetype ); // Always send this.
if ( ! str_contains( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS' ) ) {
header( 'Content-Length: ' . filesize( $file ) );
header( 'Content-Length: ' . wp_filesize( $file ) );
}

// Optional support for X-Sendfile and X-Accel-Redirect.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1581,7 +1581,7 @@ protected function check_upload_size( $file ) {

$space_left = get_upload_space_available();

$file_size = filesize( $file['tmp_name'] );
$file_size = wp_filesize( $file['tmp_name'] );

if ( $space_left < $file_size ) {
return new WP_Error(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function export() {
$theme_name = basename( get_stylesheet() );
header( 'Content-Type: application/zip' );
header( 'Content-Disposition: attachment; filename=' . $theme_name . '.zip' );
header( 'Content-Length: ' . filesize( $filename ) );
header( 'Content-Length: ' . wp_filesize( $filename ) );
flush();
readfile( $filename );
unlink( $filename );
Expand Down
Loading