Skip to content

Commit

Permalink
Fixed PHP_OS check in cron.php (#3113)
Browse files Browse the repository at this point in the history
  • Loading branch information
elidrissidev authored and fballiano committed Mar 22, 2023
1 parent cbfb537 commit ee165a3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@
umask(0);

$disabledFuncs = array_map('trim', preg_split("/,|\s+/", strtolower(ini_get('disable_functions'))));
$isWinOS = !str_contains(strtolower(PHP_OS), 'darwin') && str_contains(strtolower(PHP_OS), 'win');
$isShellDisabled = in_array('shell_exec', $disabledFuncs)
|| !str_contains(strtolower(PHP_OS), 'win')
|| $isWinOS
|| !shell_exec('which expr 2>/dev/null')
|| !shell_exec('which ps 2>/dev/null')
|| !shell_exec('which sed 2>/dev/null');

try {
if (stripos(PHP_OS, 'win') === false) {
if (!$isWinOS) {
$options = getopt('m::');
if (isset($options['m'])) {
if ($options['m'] == 'always') {
Expand Down

0 comments on commit ee165a3

Please sign in to comment.