aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrion Vibber <brion@users.mediawiki.org>2005-10-16 20:32:25 +0000
committerBrion Vibber <brion@users.mediawiki.org>2005-10-16 20:32:25 +0000
commit9734dfbd366b9eaef553f9f1c9fa0f0fb8017ac7 (patch)
tree2dd0d65ca7dea4315e4bdf4a36a9adbd69a4d557
parentaff5547b90f00781fa0471dccb70ab2dfcb0b799 (diff)
downloadmediawikicore-9734dfbd366b9eaef553f9f1c9fa0f0fb8017ac7.tar.gz
mediawikicore-9734dfbd366b9eaef553f9f1c9fa0f0fb8017ac7.zip
* Backport database connect error display fix from HEAD
Notes
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/11379
-rw-r--r--RELEASE-NOTES1
-rw-r--r--includes/Database.php11
2 files changed, 7 insertions, 5 deletions
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 8ff412f2dd56..57aac2f650a6 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -819,6 +819,7 @@ of MediaWiki:Newpagetext) to &action=edit, if page is new.
versions for convenient harvesting by automated worms
* (bug 3684) Fix typo in fatal error backtraces in Hooks.php
* Backport fix for reference usage notice in Special:Search on PHP 4.4.0
+* Backport database connect error display fix from HEAD
=== Caveats ===
diff --git a/includes/Database.php b/includes/Database.php
index e482b8dbba81..c6554a1dbc7f 100644
--- a/includes/Database.php
+++ b/includes/Database.php
@@ -1620,13 +1620,12 @@ class ResultWrapper {
*/
function wfEmergencyAbort( &$conn, $error ) {
global $wgTitle, $wgUseFileCache, $title, $wgInputEncoding, $wgOutputEncoding;
- global $wgSitename, $wgServer, $wgMessageCache;
+ global $wgSitename, $wgServer, $wgMessageCache, $wgLogo;
# I give up, Brion is right. Getting the message cache to work when there is no DB is tricky.
# Hard coding strings instead.
- $noconnect = 'Sorry! The wiki is experiencing some technical difficulties, and cannot contact the database server. <br />
-$1';
+ $noconnect = "<h1><img src='$wgLogo' style='float:left;margin-right:1em' alt=''>$wgSitename has a problem</h1><p><strong>Sorry! This site is experiencing technical difficulties.</strong></p><p>Try waiting a few minutes and reloading.</p><p><small>(Can't contact the database server: $1)</small></p>";
$mainpage = 'Main Page';
$searchdisabled = <<<EOT
<p style="margin: 1.5em 2em 1em">$wgSitename search is disabled for performance reasons. You can search via Google in the meantime.
@@ -1664,11 +1663,13 @@ border=\"0\" ALT=\"Google\"></A>
}
# No database access
- $wgMessageCache->disable();
+ if ( is_object( $wgMessageCache ) ) {
+ $wgMessageCache->disable();
+ }
$msg = wfGetSiteNotice();
if($msg == '') {
- $msg = str_replace( '$1', $error, $noconnect );
+ $msg = str_replace( '$1', htmlspecialchars( $error ), $noconnect );
}
$text = $msg;