Skip to content

Commit 94e0913

Browse files
authored
Merge pull request #4739 from codeigniter4/is-cli-detection
Additional check for `$argv` variable when detecting CLI
2 parents 5bd41fb + d48dc2a commit 94e0913

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

system/Common.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ function is_cli(): bool
763763
return true;
764764
}
765765

766-
if (! isset($_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_USER_AGENT']))
766+
if (! isset($_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_USER_AGENT']) && isset($_SERVER['argv']) && count($_SERVER['argv']) > 0)
767767
{
768768
return true;
769769
}

0 commit comments

Comments
 (0)