diff -u b/includes/bootstrap.inc b/includes/bootstrap.inc --- b/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -2350,6 +2350,30 @@ } /** + * We don't want to call watchdog if anywhere in the array there is a + * PDOException since PHP won't let us log a PDOException back to the DB. The + * function will check for the exception recursively through the array and + * return TRUE if it finds it. + * + * @param type $array + * The array to check, will likely be $error from calling function + * + * @return boolean + * TRUE if found. + */ +function array_has_PDOException($array) { + if (array_key_exists('%type', $array) && stripos($array['%type'], 'PDOException') !== FALSE) { + return TRUE; + } + foreach ($array as $value) { + if (is_array($value) && array_has_PDOException($value)) { + return TRUE; + } + } + return FALSE; +} + +/** * Provides custom PHP error handling. * * @param $error_level diff -u b/includes/errors.inc b/includes/errors.inc --- b/includes/errors.inc +++ b/includes/errors.inc @@ -329,28 +329,6 @@ } /** - * We don't want to call watchdog if anywhere in the array there is a PDOException since PHP won't let us log a PDOException back to the DB. - * The function will check for the exception and return TRUE if it finds it in an array. It checks recursively through the array. - * - * @param type $array - * The array to check, will likely be $error from calling function - * - * @return boolean - * TRUE if found. - */ -function array_has_PDOException($array) { - if (array_key_exists('%type', $array) && stripos($array['%type'], 'PDOException') !== FALSE) { - return TRUE; - } - foreach ($array as $value) { - if (is_array($value) && array_has_PDOException($value)) { - return TRUE; - } - } - return FALSE; -} - -/** * Formats a backtrace into an HTML table. * * @param array $backtrace