issue #107: previous fix caused all requests with "register_argc_argv" on to be detected as CLI.

This commit is contained in:
Pepijn Over 2014-07-28 09:23:14 +02:00
parent 1fe4c9a293
commit eee14aea53
1 changed files with 2 additions and 3 deletions

View File

@ -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');
}
###############################################