Skip to content

Commit e7cab97

Browse files
committed
Use the more appropriate is_array instead of !empty
1 parent 2f0e632 commit e7cab97

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

interface/web/sites/web_vhost_domain_edit.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,20 +1451,20 @@ function onAfterUpdate() {
14511451

14521452
if(isset($this->dataRecord['folder_directive_snippets'])) $app->db->query("UPDATE web_domain SET folder_directive_snippets = ? WHERE domain_id = ?", $this->dataRecord['folder_directive_snippets'], $this->id);
14531453

1454-
// Trigger an update of the website's cronjobs when the PHP version is changed
1454+
// Triggers an update of the website's cronjobs and shell users when the PHP version is changed
14551455
if(isset($this->dataRecord['server_php_id']) && $this->oldDataRecord['server_php_id'] != $this->dataRecord['server_php_id']) {
14561456
$cronjob_list = $app->db->queryAllRecords("SELECT * FROM cron WHERE parent_domain_id = ? and active = 'y'", $this->dataRecord['id']);
1457-
if(!empty($cronjob_list)) {
1458-
foreach ($cronjob_list as $cronjob) {
1457+
if(is_array($cronjob_list)) {
1458+
foreach($cronjob_list as $cronjob) {
14591459
// Only update cronjobs with placeholders
14601460
if(preg_match("/([\{][a-zA-Z_\-0-9]+[\}]|[\[][a-zA-Z_\-0-9]+[\]])/", $cronjob['command'])) {
14611461
$app->db->datalogUpdate('cron', $cronjob, 'id', $cronjob['id'], true);
14621462
}
14631463
}
14641464
}
14651465
$shelluser_list = $app->db->queryAllRecords("SELECT * FROM shell_user WHERE parent_domain_id = ? and active = 'y'", $this->dataRecord['id']);
1466-
if(!empty($shelluser_list)) {
1467-
foreach ($shelluser_list as $shelluser) {
1466+
if(is_array($shelluser_list)) {
1467+
foreach($shelluser_list as $shelluser) {
14681468
$app->db->datalogUpdate('shell_user', $shelluser, 'shell_user_id', $shelluser['shell_user_id'], true);
14691469
}
14701470
}

0 commit comments

Comments
 (0)