From: Craig Andrews Date: Tue, 2 Mar 2010 02:53:10 +0000 (-0500) Subject: Don't attempt to retrieve the current user from the DB while processing a DB error X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=68347691b0c7fb3f81415abd7fcdc5aec85cc554;p=quix0rs-gnu-social.git Don't attempt to retrieve the current user from the DB while processing a DB error --- diff --git a/index.php b/index.php index 88658a3ad6..215d1f676e 100644 --- a/index.php +++ b/index.php @@ -92,6 +92,12 @@ function handleError($error) || $error instanceof DB_Error || ($error instanceof PEAR_Exception && $error->getCode() == -24) ) { + //If we run into a DB error, assume we can't connect to the DB at all + //so set the current user to null, so we don't try to access the DB + //while rendering the error page. + global $_cur; + $_cur = null; + $msg = sprintf( _( 'The database for %s isn\'t responding correctly, '.