From 617395c33d234c44db797ae88ffefee094282979 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Tue, 4 Jan 2011 00:42:48 +0000 Subject: [PATCH] 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) --- includes/db/Database.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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 ); } -- 2.20.1