summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-09-20 16:52:22 -0700
committerBrion Vibber <brion@pobox.com>2010-09-20 16:52:22 -0700
commitaef42e2f65d67db0c27521a69d15675515c9a80c (patch)
treef7b4f6cd284fd689bf482880b8cc16a3ed6cfe93
parenta47e66409488dac8ff3e59f97a5b0fb496ec4115 (diff)
Don't spew a notice warning to output while processing logging for PEAR DB errors
-rw-r--r--lib/util.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/util.php b/lib/util.php
index e0457140e..dc853f657 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -1480,7 +1480,12 @@ function common_log_db_error(&$object, $verb, $filename=null)
{
$objstr = common_log_objstring($object);
$last_error = &PEAR::getStaticProperty('DB_DataObject','lastError');
- common_log(LOG_ERR, $last_error->message . '(' . $verb . ' on ' . $objstr . ')', $filename);
+ if (is_object($last_error)) {
+ $msg = $last_error->message;
+ } else {
+ $msg = 'Unknown error (' . var_export($last_error, true) . ')';
+ }
+ common_log(LOG_ERR, $msg . '(' . $verb . ' on ' . $objstr . ')', $filename);
}
function common_log_objstring(&$object)