Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit 371ccca3503f3652b2c8829c50e9ef72668c5bcd 1 parent 688d853
Damian Mooyman tractorcow authored
Showing with 2 additions and 2 deletions.
  1. +1 −1  dev/Backtrace.php
  2. +1 −1  dev/Log.php
2  dev/Backtrace.php
View
@@ -90,7 +90,7 @@ public static function filter_backtrace($bt, $ignoredFunctions = null) {
// 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;
2  dev/Log.php
View
@@ -94,7 +94,7 @@ public static function get_logger() {
// 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);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.