From eee14aea5388b750a7743acf2c37faadf1e68d85 Mon Sep 17 00:00:00 2001 From: Pepijn Over Date: Mon, 28 Jul 2014 09:23:14 +0200 Subject: [PATCH] issue #107: previous fix caused all requests with "register_argc_argv" on to be detected as CLI. --- src/includes/functions.inc.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/includes/functions.inc.php b/src/includes/functions.inc.php index ec004b98..788e9d24 100644 --- a/src/includes/functions.inc.php +++ b/src/includes/functions.inc.php @@ -516,12 +516,11 @@ function psm_POST($key, $alt = null) { /** * Check if we are in CLI mode * - * Note, php_sapi cannot be used because cgi-fcgi returns both for web and cli - * source: https://api.drupal.org/api/drupal/includes!bootstrap.inc/function/drupal_is_cli/7 + * Note, php_sapi cannot be used because cgi-fcgi returns both for web and cli. * @return boolean */ function psm_is_cli() { - return (php_sapi_name() == 'cli' || (is_numeric($_SERVER['argc']) && $_SERVER['argc'] > 0)); + return (!isset($_SERVER['SERVER_SOFTWARE']) || php_sapi_name() == 'cli'); } ###############################################