|
149 | 149 | $configValues['CONFIG_MAIL_SMTP_PASSWORD'] = ""; |
150 | 150 | } |
151 | 151 |
|
| 152 | + // validate email charset |
| 153 | + if ( |
| 154 | + array_key_exists('CONFIG_MAIL_CHARSET', $_POST) && |
| 155 | + !empty(trim($_POST['CONFIG_MAIL_CHARSET'])) && |
| 156 | + in_array(strtolower(trim($_POST['CONFIG_MAIL_CHARSET'])), array("utf-8", "iso-8859-1", "us-ascii", "utf-16", "windows-1251", "iso-8859-15", "iso-2022-jp", "shift-jis", "koi8-r", "windows-1252", "iso-8859-5")) |
| 157 | + ) { |
| 158 | + $configValues['CONFIG_MAIL_CHARSET'] = strtolower(trim($_POST['CONFIG_MAIL_CHARSET'])); |
| 159 | + } else { |
| 160 | + $configValues['CONFIG_MAIL_CHARSET'] = "utf-8"; |
| 161 | + } |
| 162 | + |
152 | 163 | // display message |
153 | 164 | if (count($invalid_input) > 0) { |
154 | 165 | $failureMsg = sprintf("Invalid input: [%s]", implode(", ", array_values($invalid_input))); |
|
300 | 311 | "tooltipText" => "A prefix for the email subjects", |
301 | 312 | ); |
302 | 313 |
|
| 314 | + $input_descriptors1[] = array( |
| 315 | + "type" => "select", |
| 316 | + "options" => array("utf-8", "iso-8859-1", "us-ascii", "utf-16", "windows-1251", "iso-8859-15", "iso-2022-jp", "shift-jis", "koi8-r", "windows-1252", "iso-8859-5"), |
| 317 | + "caption" => "Email Character Encoding", |
| 318 | + "name" => 'CONFIG_MAIL_CHARSET', |
| 319 | + "selected_value" => (!array_key_exists('CONFIG_MAIL_CHARSET', $invalid_input) |
| 320 | + ? $configValues['CONFIG_MAIL_CHARSET'] : "utf-8"), |
| 321 | + "tooltipText" => "Character encoding for outgoing emails", |
| 322 | + ); |
| 323 | + |
303 | 324 |
|
304 | 325 | $fieldset1_descriptor = array( |
305 | 326 | "title" => "Other settings", |
|
0 commit comments