Skip to content

Commit

Permalink
Merge pull request #4739 from codeigniter4/is-cli-detection
Browse files Browse the repository at this point in the history
Additional check for `$argv` variable when detecting CLI
  • Loading branch information
MGatner authored May 25, 2021
2 parents 5bd41fb + d48dc2a commit 94e0913
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion system/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ function is_cli(): bool
return true;
}

if (! isset($_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_USER_AGENT']))
if (! isset($_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_USER_AGENT']) && isset($_SERVER['argv']) && count($_SERVER['argv']) > 0)
{
return true;
}
Expand Down

0 comments on commit 94e0913

Please sign in to comment.