Skip to content

Commit 7de9c4d

Browse files
author
Till Brehm
committed
Issue #3872: Fixed syntax incompatibility with old PHP versions.
1 parent 181ee7e commit 7de9c4d

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

interface/web/sites/database_quota_stats.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ function prepareDataRow($rec) {
5757
if(!empty($monitor_data[$rec['server_id'].'.'.$database_name])){
5858
$rec['database'] = $monitor_data[$rec['server_id'].'.'.$database_name]['database_name'];
5959
$rec['client'] = $monitor_data[$rec['server_id'].'.'.$database_name]['client'];
60-
$rec['server_name'] = $app->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = ?", $rec['server_id'])['server_name'];
60+
$tmp = $app->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = ?", $rec['server_id']);
61+
$rec['server_name'] = $tmp['server_name'];
62+
unset($tmp);
6163
$rec['used'] = $monitor_data[$rec['server_id'].'.'.$database_name]['used'];
6264
$rec['quota'] = $monitor_data[$rec['server_id'].'.'.$database_name]['quota'];
6365

server/plugins-available/apache2_plugin.inc.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -882,9 +882,9 @@ function update($event_name, $data) {
882882
}
883883

884884
// get the primitive folder for document_root and the filesystem, will need it later.
885-
$df_output=exec("df -T $document_root|awk 'END{print \$2,\$NF}'");
886-
$file_system = explode(" ", $df_output)[0];
887-
$primitive_root = explode(" ", $df_output)[1];
885+
$df_output=explode(" ", exec("df -T $document_root|awk 'END{print \$2,\$NF}'"));
886+
$file_system = $df_output[0];
887+
$primitive_root = $df_output[1];
888888

889889
if ( in_array($file_system , array('ext2','ext3','ext4'), true) ) {
890890
exec('setquota -u '. $username . ' ' . $blocks_soft . ' ' . $blocks_hard . ' 0 0 -a &> /dev/null');

server/plugins-available/cron_plugin.inc.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ function update($event_name, $data) {
136136
}
137137

138138
// get the primitive folder for document_root and the filesystem, will need it later.
139-
$df_output=exec("df -T $document_root|awk 'END{print \$2,\$NF}'");
140-
$file_system = explode(" ", $df_output)[0];
141-
$primitive_root = explode(" ", $df_output)[1];
139+
$df_output=explode(" ", exec("df -T $document_root|awk 'END{print \$2,\$NF}'"));
140+
$file_system = $df_output[0];
141+
$primitive_root = $df_output[1];
142142

143143
if ( in_array($file_system , array('ext2','ext3','ext4'),true) ) {
144144
exec('setquota -u '. $username . ' ' . $blocks_soft . ' ' . $blocks_hard . ' 0 0 -a &> /dev/null');

server/plugins-available/mail_plugin.inc.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,9 @@ function user_insert($event_name, $data) {
206206
}
207207

208208
//* Send the welcome email message
209-
$domain = explode('@', $data["new"]["email"])[1];
209+
$tmp = explode('@', $data["new"]["email"]);
210+
$domain = $tmp[1];
211+
unset($tmp);
210212
$html = false;
211213
if(file_exists($conf['rootpath'].'/conf-custom/mail/welcome_email_'.$domain.'.html')) {
212214
$lines = file($conf['rootpath'].'/conf-custom/mail/welcome_email_'.$domain.'.html');
@@ -466,7 +468,9 @@ function user_delete($event_name, $data) {
466468
if( $server_config['backup_dir_is_mount'] == 'y' && !$app->system->mount_backup_dir($backup_dir) ) $mount_backup = false;
467469
if($mount_backup){
468470
$sql = "SELECT * FROM mail_domain WHERE domain = ?";
469-
$domain_rec = $app->db->queryOneRecord($sql, explode("@",$data['old']['email'])[1]);
471+
$tmp = explode("@",$data['old']['email']);
472+
$domain_rec = $app->db->queryOneRecord($sql,$tmp[1]);
473+
unset($tmp);
470474
if (is_array($domain_rec)) {
471475
$mail_backup_dir = $backup_dir.'/mail'.$domain_rec['domain_id'];
472476
$mail_backup_files = 'mail'.$data['old']['mailuser_id'];

server/plugins-available/nginx_plugin.inc.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -741,9 +741,9 @@ function update($event_name, $data) {
741741
}
742742

743743
// get the primitive folder for document_root and the filesystem, will need it later.
744-
$df_output=exec("df -T $document_root|awk 'END{print \$2,\$NF}'");
745-
$file_system = explode(" ", $df_output)[0];
746-
$primitive_root = explode(" ", $df_output)[1];
744+
$df_output=explode(" ", exec("df -T $document_root|awk 'END{print \$2,\$NF}'"));
745+
$file_system = $df_output[0];
746+
$primitive_root = $df_output[1];
747747

748748
if ( in_array($file_system , array('ext2','ext3','ext4'), true) ) {
749749
exec('setquota -u '. $username . ' ' . $blocks_soft . ' ' . $blocks_hard . ' 0 0 -a &> /dev/null');

0 commit comments

Comments
 (0)