From c16556dd84c84ddcd3356921d0e37e6c77ec22b5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Sun, 9 Jan 2011 18:31:52 +0000 Subject: [PATCH] Partial revert of r79903, unstubbing needs localisation cache which might need database --- includes/Exception.php | 4 ++-- includes/db/Database.php | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/includes/Exception.php b/includes/Exception.php index cd209abae3..afa46ce2ea 100644 --- a/includes/Exception.php +++ b/includes/Exception.php @@ -39,7 +39,7 @@ class MWException extends Exception { } } - return is_object( $wgLang ); + return $wgLang instanceof Language; } /** @@ -243,7 +243,7 @@ class MWException extends Exception { $dir = 'ltr'; $code = 'en'; - if ( $this->useMessageCache() ) { + if ( $wgLang instanceof Language ) { $left = $wgLang->alignStart(); $right = $wgLang->alignEnd(); $dir = $wgLang->getDir(); diff --git a/includes/db/Database.php b/includes/db/Database.php index f2bce439c9..4d75379c58 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -2845,7 +2845,7 @@ class DBConnectionError extends DBError { $header = "$wgSitename has a problem"; - if ( is_object( $wgLang ) ) { + if ( $wgLang instanceof Language ) { $header = htmlspecialchars( $wgLang->getMessage( 'dberr-header' ) ); } @@ -2859,7 +2859,7 @@ class DBConnectionError extends DBError { $again = 'Try waiting a few minutes and reloading.'; $info = '(Can\'t contact the database server: $1)'; - if ( is_object( $wgLang ) ) { + if ( $wgLang instanceof Language ) { $sorry = htmlspecialchars( $wgLang->getMessage( 'dberr-problems' ) ); $again = htmlspecialchars( $wgLang->getMessage( 'dberr-again' ) ); $info = htmlspecialchars( $wgLang->getMessage( 'dberr-info' ) ); @@ -2896,7 +2896,7 @@ class DBConnectionError extends DBError { $cachederror = "This is a cached copy of the requested page, and may not be up to date. "; # Localize it if possible... - if ( is_object( $wgLang ) ) { + if ( $wgLang instanceof Language ) { $cachederror = htmlspecialchars( $wgLang->getMessage( 'dberr-cachederror' ) ); } @@ -2921,7 +2921,7 @@ class DBConnectionError extends DBError { $outofdate = "Note that their indexes of our content may be out of date."; $googlesearch = "Search"; - if ( is_object( $wgLang ) ) { + if ( $wgLang instanceof Language ) { $usegoogle = htmlspecialchars( $wgLang->getMessage( 'dberr-usegoogle' ) ); $outofdate = htmlspecialchars( $wgLang->getMessage( 'dberr-outofdate' ) ); $googlesearch = htmlspecialchars( $wgLang->getMessage( 'searchbutton' ) ); @@ -2963,7 +2963,7 @@ EOT; $mainpage = 'Main Page'; - if ( is_object( $wgLang ) ) { + if ( $wgLang instanceof Language ) { $mainpage = htmlspecialchars( $wgLang->getMessage( 'mainpage' ) ); } -- 2.20.1