Fixed bug #14117: RuntimeException thrown within the exception handler when wrong...
authorPatrick Broens <patrick@netcreators.com>
Thu, 15 Apr 2010 18:42:58 +0000 (18:42 +0000)
committerPatrick Broens <patrick@netcreators.com>
Thu, 15 Apr 2010 18:42:58 +0000 (18:42 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7372 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/error/class.t3lib_error_abstractexceptionhandler.php

index 13d7bab..37c71ac 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-04-15  Patrick Broens  <patrick@patrickbroens.nl>
+
+       * Fixed bug #14117: RuntimeException thrown within the exception handler when wrong database credentials
+
 2010-04-15  Dmitry Dulepov  <dmitry.dulepov@gmail.com>
 
        * Fixed bug #14021: Simplify the code to get nested GET Parameters with TS
index bcc42df..40ac0c1 100644 (file)
@@ -73,23 +73,30 @@ abstract class t3lib_error_AbstractExceptionHandler implements t3lib_error_Excep
                        // write error message to the configured syslogs
                t3lib_div::sysLog($logMessage, $logTitle, 4);
 
-                       // In case an error occurs before a database connection exists, try
-                       // to connect to the DB to be able to write the devlog/sys_log entry
-               if (isset($GLOBALS['TYPO3_DB']) && is_object($GLOBALS['TYPO3_DB']) && empty($GLOBALS['TYPO3_DB']->link)) {
-                       $GLOBALS['TYPO3_DB']->connectDB();
-               }
+                       // When database credentials are wrong, the exception is probably
+                       // caused by this. Therefor we cannot do any database operation,
+                       // otherwise this will lead into recurring exceptions.
+               try {
+                               // In case an error occurs before a database connection exists, try
+                               // to connect to the DB to be able to write the devlog/sys_log entry
+                       if (isset($GLOBALS['TYPO3_DB']) && is_object($GLOBALS['TYPO3_DB']) && empty($GLOBALS['TYPO3_DB']->link)) {
+                               $GLOBALS['TYPO3_DB']->connectDB();
+                       }
 
-                       // write error message to devlog
-                       // see: $TYPO3_CONF_VARS['SYS']['enable_exceptionDLOG']
-               if (TYPO3_EXCEPTION_DLOG) {
-                       t3lib_div::devLog($logMessage, $logTitle, 3, array(
-                               'TYPO3_MODE' => TYPO3_MODE,
-                               'backtrace' => $backtrace
-                       ));
-               }
+                               // write error message to devlog
+                               // see: $TYPO3_CONF_VARS['SYS']['enable_exceptionDLOG']
+                       if (TYPO3_EXCEPTION_DLOG) {
+                               t3lib_div::devLog($logMessage, $logTitle, 3, array(
+                                       'TYPO3_MODE' => TYPO3_MODE,
+                                       'backtrace' => $backtrace
+                               ));
+                       }
 
-                       // write error message to sys_log table
-               $this->writeLog($logTitle . ': ' . $logMessage);
+                               // write error message to sys_log table
+                       $this->writeLog($logTitle . ': ' . $logMessage);
+               } catch (Exception $exception) {
+                       // Nothing happens here. It seems the database credentials are wrong
+               }
        }
 
        /**