Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -3451,8 +3451,8 @@ |
3452 | 3452 | function wfMemoryLimit() { |
3453 | 3453 | global $wgMemoryLimit; |
3454 | 3454 | $memlimit = wfShorthandToInteger( ini_get( 'memory_limit' ) ); |
3455 | | - $conflimit = wfShorthandToInteger( $wgMemoryLimit ); |
3456 | 3455 | if( $memlimit != -1 ) { |
| 3456 | + $conflimit = wfShorthandToInteger( $wgMemoryLimit ); |
3457 | 3457 | if( $conflimit == -1 ) { |
3458 | 3458 | wfDebug( "Removing PHP's memory limit\n" ); |
3459 | 3459 | wfSuppressWarnings(); |
— | — | @@ -3477,17 +3477,22 @@ |
3478 | 3478 | */ |
3479 | 3479 | function wfShorthandToInteger( $string = '' ) { |
3480 | 3480 | $string = trim( $string ); |
3481 | | - if( empty( $string ) ) { |
| 3481 | + if( $string === '' ) { |
3482 | 3482 | return -1; |
3483 | 3483 | } |
3484 | | - $last = strtolower( $string[strlen( $string ) - 1] ); |
| 3484 | + $last = $string[strlen( $string ) - 1]; |
3485 | 3485 | $val = intval( $string ); |
3486 | 3486 | switch( $last ) { |
3487 | 3487 | case 'g': |
| 3488 | + case 'G': |
3488 | 3489 | $val *= 1024; |
| 3490 | + // break intentionally missing |
3489 | 3491 | case 'm': |
| 3492 | + case 'M': |
3490 | 3493 | $val *= 1024; |
| 3494 | + // break intentionally missing |
3491 | 3495 | case 'k': |
| 3496 | + case 'K': |
3492 | 3497 | $val *= 1024; |
3493 | 3498 | } |
3494 | 3499 | |