1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-30 11:20:25 +02:00

Silence debug prints clearly not meant for CLI

- FIX: e_array::unserialize() HTML vomit in CLI mode
- FIX: e107_debug_shutdown() HTML vomit because $error_handler was not global
This commit is contained in:
Nick Liu
2020-01-18 18:57:43 +01:00
parent be8f2bbeb6
commit 52116adc89
2 changed files with 4 additions and 3 deletions

View File

@@ -143,6 +143,7 @@ if(!defined('e_ROOT'))
// D: Setup PHP error handling
// (Now we can see PHP errors) -- but note that DEBUG is not yet enabled!
//
global $error_handler;
$error_handler = new error_handler();
//
@@ -2412,8 +2413,8 @@ function force_userupdate($currentUser)
class error_handler
{
var $errors;
var $debug = false;
public $errors = [];
public $debug = false;
protected $xdebug = false;
protected $docroot = '';
protected $label = array();

View File

@@ -457,7 +457,7 @@ class e_array {
// e107::getDebug()->log("Json data found");
if(json_last_error() != JSON_ERROR_NONE && (e_DEBUG === true))
if(json_last_error() != JSON_ERROR_NONE && e_DEBUG === true && !e107::isCli())
{
echo "<div class='alert alert-danger'><h4>e107::unserialize() Parser Error (json)</h4></div>";
echo "<pre>";