Remove nasty ancient global $title (at least $wgTitle is easier to grep for), its...
authorChad Horohoe <demon@users.mediawiki.org>
Tue, 4 Jan 2011 00:42:48 +0000 (00:42 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Tue, 4 Jan 2011 00:42:48 +0000 (00:42 +0000)
It's not a title object, it's a string of what title= in the URL. If you want that, use WebRequest::getText() or something. Using this string is *wrong* and any extensions should be fixed (I didn't check because $title is a PITA to grep for). Don't backport to 1.17 because this is trivial, harmless, and may Break Something.

(Also made fileCachedPage private since it has no outside callers and I can't see any reason why you should)

includes/db/Database.php

index 95d572f..449a9d2 100644 (file)
@@ -2927,8 +2927,8 @@ EOT;
                return $trygoogle;
        }
 
-       function fileCachedPage() {
-               global $wgTitle, $title, $wgLang, $wgOut;
+       private function fileCachedPage() {
+               global $wgTitle, $wgLang, $wgOut;
 
                if ( $wgOut->isDisabled() ) {
                        return; // Done already?
@@ -2937,13 +2937,11 @@ EOT;
                $mainpage = 'Main Page';
 
                if ( $wgLang instanceof Language ) {
-                       $mainpage    = htmlspecialchars( $wgLang->getMessage( 'mainpage' ) );
+                       $mainpage = htmlspecialchars( $wgLang->getMessage( 'mainpage' ) );
                }
 
                if ( $wgTitle ) {
                        $t =& $wgTitle;
-               } elseif ( $title ) {
-                       $t = Title::newFromURL( $title );
                } else {
                        $t = Title::newFromText( $mainpage );
                }