@@ -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