From aef42e2f65d67db0c27521a69d15675515c9a80c Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 20 Sep 2010 16:52:22 -0700 Subject: [PATCH] Don't spew a notice warning to output while processing logging for PEAR DB errors --- lib/util.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/util.php b/lib/util.php index e0457140e2..dc853f657b 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)