From d7d3a50d8751f071aa95541813af1d190e71430e Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Mon, 1 Mar 2010 21:53:10 -0500 Subject: [PATCH] Don't attempt to retrieve the current user from the DB while processing a DB error --- index.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.php b/index.php index 78c4de62a3..66a9838d65 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, '. -- 2.39.5