Skip to content

Commit 2a3441e

Browse files
authored
hestiacp#2634 If issues due to use of old translation method (hestiacp#2637)
* Do not use _(string,value) but sprintf(_('xxx'),'xxx') * Add some extra locations * Other affected locations
1 parent b81f503 commit 2a3441e

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

web/add/web/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@
434434
if (!empty($v_ftp_user_data['v_ftp_user'])) {
435435
$pw_len = strlen($v_ftp_user_data['v_ftp_password']);
436436
if ($pw_len < 6) {
437-
$_SESSION['error_msg'] = _('Password is too short.', $error_msg);
437+
$_SESSION['error_msg'] = sprintf(_('Password is too short.'), $error_msg);
438438
}
439439
}
440440
}

web/edit/mail/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@
382382
$error_msg = $error_msg.", ".$error;
383383
}
384384
}
385-
$_SESSION['error_msg'] = _('Field "%s" can not be blank.', $error_msg);
385+
$_SESSION['error_msg'] = sprintf(_('Field "%s" can not be blank.'), $error_msg);
386386
} else {
387387
exec('mktemp -d', $mktemp_output, $return_var);
388388
$tmpdir = $mktemp_output[0];

web/edit/package/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@
208208
$error_msg = $error_msg.", ".$error;
209209
}
210210
}
211-
$_SESSION['error_msg'] = _('Field "%s" can not be blank.', $error_msg);
211+
$_SESSION['error_msg'] = sprintf(_('Field "%s" can not be blank.'), $error_msg);
212212
}
213213

214214
// Protect input

web/edit/web/index.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@
556556
$error_msg = $error_msg.", ".$error;
557557
}
558558
}
559-
$_SESSION['error_msg'] = _('Field "%s" can not be blank.', $error_msg);
559+
$_SESSION['error_msg'] = sprintf(_('Field "%s" can not be blank.'), $error_msg);
560560
} else {
561561
exec('mktemp -d', $mktemp_output, $return_var);
562562
$tmpdir = $mktemp_output[0];
@@ -702,7 +702,7 @@
702702
$error_msg = $error_msg.", ".$error;
703703
}
704704
}
705-
$_SESSION['error_msg'] = _('Field "%s" can not be blank.', $error_msg);
705+
$_SESSION['error_msg'] = sprintf(_('Field "%s" can not be blank.'), $error_msg);
706706
} else {
707707
$v_stats_user = escapeshellarg($_POST['v_stats_user']);
708708
$v_stats_password = tempnam("/tmp", "vst");
@@ -730,7 +730,7 @@
730730
$error_msg = $error_msg.", ".$error;
731731
}
732732
}
733-
$_SESSION['error_msg'] = _('Field "%s" can not be blank.', $error_msg);
733+
$_SESSION['error_msg'] = sprintf(_('Field "%s" can not be blank.'), $error_msg);
734734
}
735735
if (($v_stats_user != $_POST['v_stats_user']) || (!empty($_POST['v_stats_password'])) && (empty($_SESSION['error_msg']))) {
736736
$v_stats_user = escapeshellarg($_POST['v_stats_user']);
@@ -770,7 +770,7 @@
770770
$error_msg = $error_msg.", ".$error;
771771
}
772772
}
773-
$_SESSION['error_msg'] = _('Field "%s" can not be blank.', $error_msg);
773+
$_SESSION['error_msg'] = sprintf(_('Field "%s" can not be blank.'), $error_msg);
774774
}
775775

776776
// Add ftp account
@@ -841,7 +841,7 @@
841841
$error_msg = $error_msg.", ".$error;
842842
}
843843
}
844-
$_SESSION['error_msg'] = _('Field "%s" can not be blank.', $error_msg);
844+
$_SESSION['error_msg'] = sprintf(_('Field "%s" can not be blank.'), $error_msg);
845845
}
846846

847847
// Change FTP account path
@@ -868,7 +868,7 @@
868868
$hostname = exec('hostname');
869869
$from = "noreply@".$hostname;
870870
$from_name = _('Hestia Control Panel');
871-
$mailtext = _('FTP_ACCOUNT_READY', escapeshellarg($_GET['domain']), $user, $v_ftp_username_for_emailing, $v_ftp_user_data['v_ftp_password']);
871+
$mailtext = sprintf(_('FTP_ACCOUNT_READY'), escapeshellarg($_GET['domain']), $user, $v_ftp_username_for_emailing, $v_ftp_user_data['v_ftp_password']);
872872
send_email($to, $subject, $mailtext, $from, $from_name);
873873
unset($v_ftp_email);
874874
}

0 commit comments

Comments
 (0)