|
27 | 27 | if (empty($_POST['v_package'])) $errrors[] = _('package'); |
28 | 28 | if (empty($_POST['v_email'])) $errors[] = _('email'); |
29 | 29 | if (empty($_POST['v_name'])) $errors[] = _('name'); |
30 | | - if (!empty($errors[0])) { |
| 30 | + if (!empty($errors)) { |
31 | 31 | foreach ($errors as $i => $error) { |
32 | 32 | if ( $i == 0 ) { |
33 | 33 | $error_msg = $error; |
34 | 34 | } else { |
35 | 35 | $error_msg = $error_msg.", ".$error; |
36 | 36 | } |
37 | 37 | } |
38 | | - $_SESSION['error_msg'] = _('Field "%s" can not be blank.',$error_msg); |
| 38 | + $_SESSION['error_msg'] = sprintf(_('Field "%s" can not be blank.'),$error_msg); |
39 | 39 | } |
40 | 40 |
|
41 | 41 | // Validate email |
|
91 | 91 | $subject = _("Welcome to Hestia Control Panel"); //currently not supported to use the account language |
92 | 92 | $hostname = exec('hostname'); |
93 | 93 | unset($output); |
94 | | - $from = _('MAIL_FROM',$hostname); //currently not supported to use the account language |
| 94 | + $from = sprintf(_('MAIL_FROM'),$hostname); //currently not supported to use the account language |
95 | 95 |
|
96 | 96 | if (!empty($_POST['v_name'])) { |
97 | | - $mailtext = _('GREETINGS_GORDON',$_POST['v_name']); |
| 97 | + $mailtext = sprintf(_('GREETINGS_GORDON'),$_POST['v_name'])."\r\n"; |
98 | 98 | } else { |
99 | | - $mailtext = _('GREETINGS'); |
| 99 | + $mailtext = _('GREETINGS')."\r\n"; |
100 | 100 | } |
101 | | - $mailtext .= _($_POST['v_language'],'ACCOUNT_READY',$_SERVER['HTTP_HOST'],$_POST['v_username'],$_POST['v_password']); |
| 101 | + $mailtext .= sprintf(_('ACCOUNT_READY'),$_SERVER['HTTP_HOST'],$_POST['v_username'],$_POST['v_password']); |
102 | 102 | send_email($to, $subject, $mailtext, $from); |
103 | 103 | } |
104 | 104 |
|
105 | 105 | // Flush field values on success |
106 | 106 | if (empty($_SESSION['error_msg'])) { |
107 | | - $_SESSION['ok_msg'] = _('USER_CREATED_OK',htmlentities($_POST['v_username']),htmlentities($_POST['v_username'])); |
| 107 | + $_SESSION['ok_msg'] = sprintf(_('USER_CREATED_OK'),htmlentities($_POST['v_username']),htmlentities($_POST['v_username'])); |
108 | 108 | $_SESSION['ok_msg'] .= " / <a href=/login/?loginas=".htmlentities($_POST['v_username']).">" . _('login as') ." ".htmlentities($_POST['v_username']). "</a>"; |
109 | 109 | unset($v_username); |
110 | 110 | unset($v_password); |
|
0 commit comments