WordPress.org

Make WordPress Core

Ticket #48083: 48083-1.patch

File 48083-1.patch, 1.4 KB (added by ayeshrajans, 8 months ago)

Improvements in the WP code base only, no third party libraries.

  • 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 1948e7a794..ff5ae3bc46 100644
    a b public function _validate_header_video( $validity, $value ) { 
    59365936                $video = get_attached_file( absint( $value ) );
    59375937                if ( $video ) {
    59385938                        $size = filesize( $video );
    5939                         if ( 8 < $size / pow( 1024, 2 ) ) { // Check whether the size is larger than 8MB.
     5939                        if ( 8 < $size / (1024 ** 2)) { // Check whether the size is larger than 8MB.
    59405940                                $validity->add(
    59415941                                        'size_too_large',
    59425942                                        __( 'This video file is too large to use as a header video. Try a shorter video or optimize the compression settings and re-upload a file that is less than 8MB. Or, upload your video to YouTube and link it with the option below.' )
  • src/wp-includes/deprecated.php

    diff --git a/src/wp-includes/deprecated.php b/src/wp-includes/deprecated.php
    index e0494d8faa..791b472b15 100644
    a b function wp_convert_bytes_to_hr( $bytes ) { 
    33463346        $units = array( 0 => 'B', 1 => 'KB', 2 => 'MB', 3 => 'GB', 4 => 'TB' );
    33473347        $log   = log( $bytes, KB_IN_BYTES );
    33483348        $power = (int) $log;
    3349         $size  = pow( KB_IN_BYTES, $log - $power );
     3349        $size  = KB_IN_BYTES ** ($log - $power);
    33503350
    33513351        if ( ! is_nan( $size ) && array_key_exists( $power, $units ) ) {
    33523352                $unit = $units[ $power ];