| 789 | | function wp_convert_hr_to_bytes( $size ) { |
| 790 | | $size = strtolower($size); |
| 791 | | $bytes = (int) $size; |
| 792 | | if ( strpos($size, 'k') !== false ) |
| 793 | | $bytes = intval($size) * 1024; |
| 794 | | elseif ( strpos($size, 'm') !== false ) |
| 795 | | $bytes = intval($size) * 1024 * 1024; |
| 796 | | elseif ( strpos($size, 'g') !== false ) |
| 797 | | $bytes = intval($size) * 1024 * 1024 * 1024; |
| | 790 | function wp_convert_hr_to_bytes( $size ) { |
| | 791 | $bytes = (float) $size; |
| | 792 | if ($bytes) { |
| | 793 | $last = strtolower( substr( $size, -1 ) ); |
| | 794 | $pos = strpos( ' kmg', $last , 1); |
| | 795 | if ( $pos ) $bytes *= pow( 1024, $pos); |
| | 796 | $bytes = round( $bytes ); |
| | 797 | } |