]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Don't attempt to retrieve the current user from the DB while processing a DB error
authorCraig Andrews <candrews@integralblue.com>
Tue, 2 Mar 2010 02:53:10 +0000 (21:53 -0500)
committerCraig Andrews <candrews@integralblue.com>
Sun, 18 Apr 2010 23:28:49 +0000 (19:28 -0400)
index.php

index 78c4de62a39d0361ea1eecb97536f9208f15c226..66a9838d65f277634f178091a0758de1416e246d 100644 (file)
--- 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, '.