X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FWebRequest.php;h=c6ddf81697234fc29f50466737efeecb859fdc21;hb=8af9c78c85b532743421507bc02b1c0d21757116;hp=26e2d455d88e0cb09617cf68cdc2924df2302a42;hpb=90b02397d0963970a00d4be798fab76218a38a87;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 26e2d455d8..c6ddf81697 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -141,7 +141,7 @@ class WebRequest { $router->add( "$wgScript/$1" ); if ( isset( $_SERVER['SCRIPT_NAME'] ) - && preg_match( '/\.php5?/', $_SERVER['SCRIPT_NAME'] ) + && preg_match( '/\.php/', $_SERVER['SCRIPT_NAME'] ) ) { # Check for SCRIPT_NAME, we handle index.php explicitly # But we do have some other .php files such as img_auth.php @@ -269,6 +269,8 @@ class WebRequest { * @since 1.27 */ public static function getRequestId() { + // This method is called from various error handlers and should be kept simple. + if ( !self::$reqId ) { self::$reqId = isset( $_SERVER['UNIQUE_ID'] ) ? $_SERVER['UNIQUE_ID'] : wfRandomString( 24 ); @@ -430,7 +432,7 @@ class WebRequest { * selected by a drop-down menu). For freeform input, see getText(). * * @param string $name - * @param string $default Optional default (or null) + * @param string|null $default Optional default (or null) * @return string|null */ public function getVal( $name, $default = null ) { @@ -780,6 +782,8 @@ class WebRequest { * @return string */ public static function getGlobalRequestURL() { + // This method is called on fatal errors; it should not depend on anything complex. + if ( isset( $_SERVER['REQUEST_URI'] ) && strlen( $_SERVER['REQUEST_URI'] ) ) { $base = $_SERVER['REQUEST_URI']; } elseif ( isset( $_SERVER['HTTP_X_ORIGINAL_URL'] )