Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / symfony / debug / Debug.php
index aaa54118e07bee54974e6256c381445757c44973..2a3d7f31593b2f428e69530d537d91ed629d4190 100644 (file)
@@ -23,10 +23,7 @@ class Debug
     /**
      * Enables the debug tools.
      *
-     * This method registers an error handler and an exception handler.
-     *
-     * If the Symfony ClassLoader component is available, a special
-     * class loader is also registered.
+     * This method registers an error handler, an exception handler and a special class loader.
      *
      * @param int  $errorReportingLevel The level of error reporting you want
      * @param bool $displayErrors       Whether to display errors (for development) or just log them (for production)
@@ -45,10 +42,10 @@ class Debug
             error_reporting(E_ALL);
         }
 
-        if (!\in_array(PHP_SAPI, array('cli', 'phpdbg'), true)) {
+        if (!\in_array(\PHP_SAPI, array('cli', 'phpdbg'), true)) {
             ini_set('display_errors', 0);
             ExceptionHandler::register();
-        } elseif ($displayErrors && (!ini_get('log_errors') || ini_get('error_log'))) {
+        } elseif ($displayErrors && (!filter_var(ini_get('log_errors'), FILTER_VALIDATE_BOOLEAN) || ini_get('error_log'))) {
             // CLI - display errors only if they're not already logged to STDERR
             ini_set('display_errors', 1);
         }