1

In simplesamlPHP library there is code

Logger::maskErrors(E_ALL);
$hidden = in_array(
    self::$HIDE_FROM_DISCOVERY, 
    $metadata['EntityAttributes'][self::$ENTITY_CATEGORY], 
    true
);
Logger::popErrorMask();

So instead of use isset($metadata['EntityAttributes'][self::$ENTITY_CATEGORY]) they decided to set error reporting to 0, and then restore it. The problem is that when I run it as a script it works, but when I plug it to the framework it still fails with error at that point. Although I dumped level there and it was really set to 0.

Also I've heard that if you have set a user defined error handler function, then error_reporting() settings are completely ignored. But global search returns no set_error_handler in project.

ogbofjnr
  • 1,688
  • 5
  • 19
  • 41

1 Answers1

0

Still it was set_error_handler(), I didn't look at the vendor folder properly. The reason why it worked in Laravel:

 public function handleError($level, $message, $file = '', $line = 0, $context = [])
    {
        if (error_reporting() & $level) {
            throw new ErrorException($message, 0, $level, $file, $line);
        }
    }

But my framework has this:

    public function handleError($code, $message, $filename = '', $line = 0)
    {
        throw new \ErrorException($message, $code, 0, $filename, $line);
    }
ogbofjnr
  • 1,688
  • 5
  • 19
  • 41