From 902841456852ae2773c8907185dd8fb5732f5474 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 6 May 2020 18:01:16 +0200 Subject: [PATCH] LScli :: handle_args() : check CLI context --- src/includes/class/class.LScli.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/includes/class/class.LScli.php b/src/includes/class/class.LScli.php index 6abba60b..5b203be4 100644 --- a/src/includes/class/class.LScli.php +++ b/src/includes/class/class.LScli.php @@ -113,6 +113,10 @@ class LScli { * @retval void **/ public static function handle_args() { + if (php_sapi_name() != "cli") { + LSlog :: fatal('Try to use LScli :: handle_args() in non-CLI context.'); + return; + } global $argv; $log_level = 'INFO'; $ldap_server_id = false;