WordPress.org

Make WordPress Core

Changes between Version 4 and Version 5 of Ticket #14889, comment 27


Ignore:
Timestamp:
06/08/11 13:04:18 (3 years ago)
Author:
hakre
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14889, comment 27

    v4 v5  
    44function wp_convert_hr_to_bytes( $size ) { 
    55        $bytes = (float) $size; 
    6         $last = strtolower( substr( $size, -1 ) ); 
    7         $pos = strpos( ' kmg', $last , 1 ); 
    8         if ( $pos ) $bytes *= pow( 1024, $pos ); 
     6        if ( $bytes ) { 
     7                $last = strtolower( substr( $size, -1 ) ); 
     8                $pos = strpos( ' kmg', $last , 1 ); 
     9                if ( $pos ) $bytes *= pow( 1024, $pos ); 
     10        } 
    911        return round( $bytes ); 
    1012}