diff options
author | Phil Davis <phil.davis@inf.org> | 2014-12-29 20:16:28 +0545 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-12-29 12:48:03 -0200 |
commit | 55f910a3de14e055b0eb2956dd729fc106e1a9ba (patch) | |
tree | 877909de534afeed676a25022a11c1db2950ab19 /etc/inc/services.inc | |
parent | 71bd5ec115673f6e64a9d25e211c11f818ff2b07 (diff) | |
download | pfsense-55f910a3de14e055b0eb2956dd729fc106e1a9ba.zip pfsense-55f910a3de14e055b0eb2956dd729fc106e1a9ba.tar.gz |
Simplify cron array comparison
This works fine - I had not thought about how arrays are compared. Using "==" checks that the key/value pairs match in both arrays, regardless of the order the arrays happen to be in, which is what we want here.
Using "===" would insist that the key/value pairs are also in the same order in the array and that the types and everything match identically, which we do not require.
Diffstat (limited to 'etc/inc/services.inc')
-rw-r--r-- | etc/inc/services.inc | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc index aaa90bd..194b4f3 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -2392,13 +2392,7 @@ function install_cron_job($command, $active=false, $minute="0", $hour="*", $mont $config['cron']['item'][] = $cron_item; write_config(sprintf(gettext("Installed cron job for %s"), $command)); } else { - if (($config['cron']['item'][$x]['minute'] == $cron_item['minute']) && - ($config['cron']['item'][$x]['hour'] == $cron_item['hour']) && - ($config['cron']['item'][$x]['mday'] == $cron_item['mday']) && - ($config['cron']['item'][$x]['month'] == $cron_item['month']) && - ($config['cron']['item'][$x]['wday'] == $cron_item['wday']) && - ($config['cron']['item'][$x]['who'] == $cron_item['who']) && - ($config['cron']['item'][$x]['command'] == $cron_item['command'])) { + if ($config['cron']['item'][$x] == $cron_item) { $cron_changed = false; log_error(sprintf(gettext("Checked cron job for %s, no change needed"), $command)); } else { |