Followup r81373, r81363
authorSam Reed <reedy@users.mediawiki.org>
Wed, 2 Feb 2011 13:02:45 +0000 (13:02 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Wed, 2 Feb 2011 13:02:45 +0000 (13:02 +0000)
PHP Notice:  Undefined variable: matches in /home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/includes/WebRequest.php on line 109

Explicitally define $matches at top of function, allowing it to always be defined for all paths

includes/WebRequest.php

index 8478e7d..2f2480f 100644 (file)
@@ -56,6 +56,7 @@ class WebRequest {
        }
 
        static public function getPathInfo( $want = 'all' ) {
+               $matches = array();
                if ( !empty( $_SERVER['REQUEST_URI'] ) ) {
                        // Slurp out the path portion to examine...
                        $url = $_SERVER['REQUEST_URI'];
@@ -70,7 +71,7 @@ class WebRequest {
                                if( $path == $wgScript && $want !== 'all' ) {
                                        // Script inside a rewrite path?
                                        // Abort to keep from breaking...
-                                       return array();
+                                       return $matches;
                                }
                                // Raw PATH_INFO style
                                $matches = self::extractTitle( $path, "$wgScript/$1" );