From fb7e47dbd78b309c3008153641b1157bf0f1bc5c Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Fri, 26 Dec 2003 01:16:15 +0000 Subject: [PATCH] Fallback to google search box when database is offline --- includes/DatabaseFunctions.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/DatabaseFunctions.php b/includes/DatabaseFunctions.php index 565d8c3999..a4cbe27d63 100644 --- a/includes/DatabaseFunctions.php +++ b/includes/DatabaseFunctions.php @@ -46,7 +46,7 @@ function wfGetDB( $altuser = "", $altpassword = "", $altserver = "", $altdb = "" /* Call this function if we couldn't contact the database... We'll try to use the cache to display something in the meantime */ function wfEmergencyAbort( $msg = "" ) { - global $wgTitle, $wgUseFileCache, $title, $wgOutputEncoding; + global $wgTitle, $wgUseFileCache, $title, $wgInputEncoding, $wgOutputEncoding; header( "Content-type: text/html; charset=$wgOutputEncoding" ); if($msg == "") $msg = wfMsgNoDB( "noconnect" ); @@ -58,6 +58,10 @@ function wfEmergencyAbort( $msg = "" ) { } else { if($title) { $t = Title::newFromURL( $title ); + } elseif ($_REQUEST['search']) { + $search = $_REQUEST['search']; + echo wfMsgNoDB( "searchdisabled", htmlspecialchars( $search ), $wgInputEncoding ); + wfAbruptExit(); } else { $t = Title::newFromText( wfMsgNoDB( "mainpage" ) ); } -- 2.20.1