Make WordPress Core


Ignore:
Timestamp:
09/21/2019 12:48:29 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Code Modernization: Use the ** operator instead of the pow() function in wp_convert_bytes_to_hr() for better performance.

Use the MB_IN_BYTES constant instead of the pow() function in WP_Customize_Manager::_validate_header_video() for better readability.

Props ayeshrajans, jrf.
Fixes #48083.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r46214 r46225  
    59275927        if ( $video ) {
    59285928            $size = filesize( $video );
    5929             if ( 8 < $size / pow( 1024, 2 ) ) { // Check whether the size is larger than 8MB.
     5929            if ( $size > 8 * MB_IN_BYTES ) {
    59305930                $validity->add(
    59315931                    'size_too_large',
Note: See TracChangeset for help on using the changeset viewer.