Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -477,9 +477,10 @@ |
478 | 478 | global $wgUrlProtocols; |
479 | 479 | |
480 | 480 | // Cache return values separately based on $includeProtocolRelative |
481 | | - static $retval = array( true => null, false => null ); |
482 | | - if ( !is_null( $retval[$includeProtocolRelative] ) ) { |
483 | | - return $retval[$includeProtocolRelative]; |
| 481 | + static $withProtRel = null, $withoutProtRel = null; |
| 482 | + $cachedValue = $includeProtocolRelative ? $withProtRel : $withoutProtRel; |
| 483 | + if ( !is_null( $cachedValue ) ) { |
| 484 | + return $cachedValue; |
484 | 485 | } |
485 | 486 | |
486 | 487 | // Support old-style $wgUrlProtocols strings, for backwards compatibility |
— | — | @@ -493,15 +494,22 @@ |
494 | 495 | } |
495 | 496 | } |
496 | 497 | |
497 | | - $retval[$includeProtocolRelative] = implode( '|', $protocols ); |
| 498 | + $retval = implode( '|', $protocols ); |
498 | 499 | } else { |
499 | 500 | // Ignore $includeProtocolRelative in this case |
500 | 501 | // This case exists for pre-1.6 compatibility, and we can safely assume |
501 | 502 | // that '//' won't appear in a pre-1.6 config because protocol-relative |
502 | 503 | // URLs weren't supported until 1.18 |
503 | | - $retval[$includeProtocolRelative] = $wgUrlProtocols; |
| 504 | + $retval = $wgUrlProtocols; |
504 | 505 | } |
505 | | - return $retval[$includeProtocolRelative]; |
| 506 | + |
| 507 | + // Cache return value |
| 508 | + if ( $includeProtocolRelative ) { |
| 509 | + $withProtRel = $retval; |
| 510 | + } else { |
| 511 | + $withoutProtRel = $retval; |
| 512 | + } |
| 513 | + return $retval; |
506 | 514 | } |
507 | 515 | |
508 | 516 | /** |