diff --git a/core/util.inc.php b/core/util.inc.php index 43863383..3280d6c4 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -1113,7 +1113,7 @@ function log_msg(string $section, int $priority, string $message, $flash=false, send_event(new LogEvent($section, $priority, $message, $args)); $threshold = defined("CLI_LOG_LEVEL") ? CLI_LOG_LEVEL : 0; - if((PHP_SAPI === 'cli') && ($priority >= $threshold)) { + if((PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') && ($priority >= $threshold)) { print date("c")." $section: $message\n"; } if($flash === true) { @@ -1639,7 +1639,7 @@ function _sanitise_environment() { ob_start(); - if(PHP_SAPI === 'cli') { + if(PHP_SAPI === 'cli' || PHP_SAPI == 'phpdbg') { if(isset($_SERVER['REMOTE_ADDR'])) { die("CLI with remote addr? Confused, not taking the risk."); } diff --git a/index.php b/index.php index c7561cbe..1f2245d8 100644 --- a/index.php +++ b/index.php @@ -91,7 +91,7 @@ try { // start the page generation waterfall $user = _get_user(); - if(PHP_SAPI === 'cli') { + if(PHP_SAPI === 'cli' || PHP_SAPI == 'phpdbg') { send_event(new CommandEvent($argv)); } else {