Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -2236,6 +2236,12 @@ |
2237 | 2237 | */ |
2238 | 2238 | function wfUrlProtocols() { |
2239 | 2239 | global $wgUrlProtocols; |
| 2240 | + |
| 2241 | + // This function is called a lot, cache its return value |
| 2242 | + // TODO: Cache this in memcached instead? |
| 2243 | + static $retval = null; |
| 2244 | + if ( !is_null( $retval ) ) |
| 2245 | + return $retval; |
2240 | 2246 | |
2241 | 2247 | // Support old-style $wgUrlProtocols strings, for backwards compatibility |
2242 | 2248 | // with LocalSettings files from 1.5 |
— | — | @@ -2244,10 +2250,12 @@ |
2245 | 2251 | foreach ($wgUrlProtocols as $protocol) |
2246 | 2252 | $protocols[] = preg_quote( $protocol, '/' ); |
2247 | 2253 | |
2248 | | - return implode( '|', $protocols ); |
| 2254 | + $retval = implode( '|', $protocols ); |
2249 | 2255 | } else { |
2250 | | - return $wgUrlProtocols; |
| 2256 | + $retval = $wgUrlProtocols; |
2251 | 2257 | } |
| 2258 | + |
| 2259 | + return $retval; |
2252 | 2260 | } |
2253 | 2261 | |
2254 | 2262 | /** |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -384,6 +384,7 @@ |
385 | 385 | $vars = array( |
386 | 386 | 'skin' => $skinName, |
387 | 387 | 'stylepath' => $wgStylePath, |
| 388 | + 'urlprotocols' => wfUrlProtocols(), |
388 | 389 | 'wgArticlePath' => $wgArticlePath, |
389 | 390 | 'wgScriptPath' => $wgScriptPath, |
390 | 391 | 'wgScriptExtension' => $wgScriptExtension, |