From 371ccca3503f3652b2c8829c50e9ef72668c5bcd Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Fri, 18 Oct 2013 14:30:10 +1300 Subject: [PATCH] BUG Less misuse of error control operator (@) This is necessary to prevent get_last_error() from returning suppressed errors when retrieving values from nested arrays --- dev/Backtrace.php | 2 +- dev/Log.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/Backtrace.php b/dev/Backtrace.php index b904e18be..608720aae 100644 --- a/dev/Backtrace.php +++ b/dev/Backtrace.php @@ -90,7 +90,7 @@ class SS_Backtrace { // Filter out arguments foreach($bt as $i => $frame) { $match = false; - if(@$bt[$i]['class']) { + if(!empty($bt[$i]['class'])) { foreach($ignoredArgs as $fnSpec) { if(is_array($fnSpec) && $bt[$i]['class'] == $fnSpec[0] && $bt[$i]['function'] == $fnSpec[1]) { $match = true; diff --git a/dev/Log.php b/dev/Log.php index 5d2d876b6..ef70dba89 100644 --- a/dev/Log.php +++ b/dev/Log.php @@ -94,7 +94,7 @@ class SS_Log { // Add default context (shouldn't change until the actual log event happens) foreach(static::$log_globals as $globalName => $keys) { foreach($keys as $key) { - $val = @$GLOBALS[$globalName][$key]; + $val = isset($GLOBALS[$globalName][$key]) ? $GLOBALS[$globalName][$key] : null; static::$logger->setEventItem(sprintf('$%s[\'%s\']', $globalName, $key), $val); } }