From: Chad Horohoe Date: Tue, 4 Jan 2011 00:42:48 +0000 (+0000) Subject: Remove nasty ancient global $title (at least $wgTitle is easier to grep for), its... X-Git-Tag: 1.31.0-rc.0~32848 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/Foo_bar_baz?a=commitdiff_plain;h=617395c33d234c44db797ae88ffefee094282979;p=lhc%2Fweb%2Fwiklou.git Remove nasty ancient global $title (at least $wgTitle is easier to grep for), its no longer set since r78512. Afaict, this generic-named global is no longer in core. 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) --- diff --git a/includes/db/Database.php b/includes/db/Database.php index 95d572f325..449a9d2336 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -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 ); }