Make WordPress Core

Ticket #55376: 55376.diff

File 55376.diff, 4.3 KB (added by nihar007, 17 months ago)

Hi,

  • src/wp-admin/includes/ms.php

    diff --git a/src/wp-admin/includes/ms.php b/src/wp-admin/includes/ms.php
    index 741d02e9c9..926a452018 100644
    a b function check_upload_size( $file ) { 
    3030
    3131        $space_left = get_upload_space_available();
    3232
    33         $file_size = filesize( $file['tmp_name'] );
     33        $file_size = wp_filesize( $file['tmp_name'] );
    3434        if ( $space_left < $file_size ) {
    3535                /* translators: %s: Required disk space in kilobytes. */
    3636                $file['error'] = sprintf( __( 'Not enough space to upload. %s KB needed.' ), number_format( ( $file_size - $space_left ) / KB_IN_BYTES ) );
  • src/wp-admin/includes/plugin.php

    diff --git a/src/wp-admin/includes/plugin.php b/src/wp-admin/includes/plugin.php
    index 3084312da5..894d161737 100644
    a b function get_mu_plugins() { 
    400400                $wp_plugins[ $plugin_file ] = $plugin_data;
    401401        }
    402402
    403         if ( isset( $wp_plugins['index.php'] ) && filesize( WPMU_PLUGIN_DIR . '/index.php' ) <= 30 ) {
     403        if ( isset( $wp_plugins['index.php'] ) && wp_filesize( WPMU_PLUGIN_DIR . '/index.php' ) <= 30 ) {
    404404                // Silence is golden.
    405405                unset( $wp_plugins['index.php'] );
    406406        }
  • src/wp-includes/class-wp-customize-manager.php

    diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php
    index fe03a93c1e..0a55fd0c18 100644
    a b final class WP_Customize_Manager { 
    60466046        public function _validate_header_video( $validity, $value ) {
    60476047                $video = get_attached_file( absint( $value ) );
    60486048                if ( $video ) {
    6049                         $size = filesize( $video );
     6049                        $size = wp_filesize( $video );
    60506050                        if ( $size > 8 * MB_IN_BYTES ) {
    60516051                                $validity->add(
    60526052                                        'size_too_large',
  • src/wp-includes/ms-files.php

    diff --git a/src/wp-includes/ms-files.php b/src/wp-includes/ms-files.php
    index 6fb7e4d276..7695c28c84 100644
    a b if ( $mime['type'] ) { 
    4242
    4343header( 'Content-Type: ' . $mimetype ); // Always send this.
    4444if ( false === strpos( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS' ) ) {
    45         header( 'Content-Length: ' . filesize( $file ) );
     45        header( 'Content-Length: ' . wp_filesize( $file ) );
    4646}
    4747
    4848// Optional support for X-Sendfile and X-Accel-Redirect.
  • src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php

    diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
    index 423347a721..fc3ffd8f10 100644
    a b class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { 
    12841284
    12851285                $space_left = get_upload_space_available();
    12861286
    1287                 $file_size = filesize( $file['tmp_name'] );
     1287                $file_size = wp_filesize( $file['tmp_name'] );
    12881288
    12891289                if ( $space_left < $file_size ) {
    12901290                        return new WP_Error(
  • src/wp-includes/rest-api/endpoints/class-wp-rest-edit-site-export-controller.php

    diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-edit-site-export-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-edit-site-export-controller.php
    index 691760812b..ddfc421cb2 100644
    a b class WP_REST_Edit_Site_Export_Controller extends WP_REST_Controller { 
    8585                $theme_name = basename( get_stylesheet() );
    8686                header( 'Content-Type: application/zip' );
    8787                header( 'Content-Disposition: attachment; filename=' . $theme_name . '.zip' );
    88                 header( 'Content-Length: ' . filesize( $filename ) );
     88                header( 'Content-Length: ' . wp_filesize( $filename ) );
    8989                flush();
    9090                readfile( $filename );
    9191                unlink( $filename );
  • src/wp-includes/script-loader.php

    diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php
    index 1c1d12a367..bb9e39cb50 100644
    a b function wp_maybe_inline_styles() { 
    28282828                                'handle' => $handle,
    28292829                                'src'    => $wp_styles->registered[ $handle ]->src,
    28302830                                'path'   => $wp_styles->registered[ $handle ]->extra['path'],
    2831                                 'size'   => filesize( $wp_styles->registered[ $handle ]->extra['path'] ),
     2831                                'size'   => wp_filesize( $wp_styles->registered[ $handle ]->extra['path'] ),
    28322832                        );
    28332833                }
    28342834        }