From 9753453ec4ed56fe8d1d07910147929d2e1a05c2 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 9 Sep 2014 01:23:52 -0700 Subject: if we have php54 don't log the whole damn stack on a db error, just the current frame --- include/dba/dba_driver.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include/dba') diff --git a/include/dba/dba_driver.php b/include/dba/dba_driver.php index c829c3714..9e1804a7d 100755 --- a/include/dba/dba_driver.php +++ b/include/dba/dba_driver.php @@ -112,8 +112,11 @@ function q($sql) { if($db && $db->connected) { $stmt = vsprintf($sql,$args); - if($stmt === false) - logger('dba: vsprintf error: ' . print_r(debug_backtrace(),true)); + if($stmt === false) { + if(version_compare(PHP_VERSION,'5.4.0') >= 0) + logger('dba: vsprintf error: ' . print_r(debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT,1),true)); + else + logger('dba: vsprintf error: ' . print_r(debug_backtrace(),true)); return $db->q($stmt); } -- cgit v1.2.3