);
}
- wfRunHooks( 'WebRequestPathInfoRouter', array( $router ) );
+ Hooks::run( 'WebRequestPathInfoRouter', array( $router ) );
$matches = $router->parse( $path );
}
* @return array
*/
public static function detectProtocol() {
- if ( ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on' ) ||
+ if ( ( !empty( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] !== 'off' ) ||
( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) &&
- $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ) ) {
+ $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https' ) ) {
return 'https';
} else {
return 'http';
}
# Allow extensions to improve our guess
- wfRunHooks( 'GetIP', array( &$ip ) );
+ Hooks::run( 'GetIP', array( &$ip ) );
if ( !$ip ) {
throw new MWException( "Unable to determine IP." );