From: Tim Starling Date: Fri, 26 Dec 2003 01:16:15 +0000 (+0000) Subject: Fallback to google search box when database is offline X-Git-Tag: 1.3.0beta1~1208 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=fb7e47dbd78b309c3008153641b1157bf0f1bc5c;p=lhc%2Fweb%2Fwiklou.git Fallback to google search box when database is offline --- 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" ) ); }