Make WordPress Core


Ignore:
Timestamp:
07/08/2016 11:26:58 AM (9 years ago)
Author:
ocean90
Message:

Boostrap: Move wp_convert_hr_to_bytes() to wp-includes/load.php.

wp_convert_hr_to_bytes() was previously defined in wp-includes/media.php because it's only used by wp_max_upload_size() in the same file.
Moving this function to load.php allows us to improve core's memory limit handling.

See #32075.

File:
1 edited

Legend:

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

    r37986 r38012  
    27782778
    27792779/**
    2780  * Converts a shorthand byte value to an integer byte value.
    2781  *
    2782  * @since 2.3.0
    2783  *
    2784  * @param string $size A shorthand byte value.
    2785  * @return int An integer byte value.
    2786  */
    2787 function wp_convert_hr_to_bytes( $size ) {
    2788     $size  = strtolower( $size );
    2789     $bytes = (int) $size;
    2790     if ( strpos( $size, 'k' ) !== false )
    2791         $bytes = intval( $size ) * KB_IN_BYTES;
    2792     elseif ( strpos( $size, 'm' ) !== false )
    2793         $bytes = intval($size) * MB_IN_BYTES;
    2794     elseif ( strpos( $size, 'g' ) !== false )
    2795         $bytes = intval( $size ) * GB_IN_BYTES;
    2796     return $bytes;
    2797 }
    2798 
    2799 /**
    28002780 * Determines the maximum upload size allowed in php.ini.
    28012781 *
Note: See TracChangeset for help on using the changeset viewer.