Skip to content

Commit 1b91daa

Browse files
author
redray
committed
fixed the utf-8 problem in all lists
1 parent 24a2f03 commit 1b91daa

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

interface/lib/classes/listform.inc.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,14 +276,15 @@ public function getSortSQL()
276276

277277
public function decode($record)
278278
{
279+
global $conf;
279280
if(is_array($record)) {
280281
foreach($this->listDef['item'] as $field){
281282
$key = $field['field'];
282283
if(isset($record[$key])) {
283284
switch ($field['datatype']){
284285
case 'VARCHAR':
285286
case 'TEXT':
286-
$record[$key] = htmlentities(stripslashes($record[$key]));
287+
$record[$key] = htmlentities(stripslashes($record[$key]),ENT_QUOTES,$conf["html_content_encoding"]);
287288
break;
288289

289290
case 'DATE':
@@ -295,15 +296,15 @@ public function decode($record)
295296
break;
296297

297298
case 'DOUBLE':
298-
$record[$key] = htmlentities($record[$key]);
299+
$record[$key] = htmlentities($record[$key],ENT_QUOTES,$conf["html_content_encoding"]);
299300
break;
300301

301302
case 'CURRENCY':
302303
$record[$key] = number_format($record[$key], 2, ',', '');
303304
break;
304305

305306
default:
306-
$record[$key] = htmlentities(stripslashes($record[$key]));
307+
$record[$key] = htmlentities(stripslashes($record[$key]),ENT_QUOTES,$conf["html_content_encoding"]);
307308
}
308309
}
309310
}
@@ -362,11 +363,12 @@ function lng($msg) {
362363
}
363364

364365
function escapeArrayValues($search_values) {
366+
global $conf;
365367

366368
$out = array();
367369
if(is_array($search_values)) {
368370
foreach($search_values as $key => $val) {
369-
$out[$key] = htmlentities($val,ENT_QUOTES);
371+
$out[$key] = htmlentities($val,ENT_QUOTES,$conf["html_content_encoding"]);
370372
}
371373
}
372374

interface/lib/classes/validate_dns.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ function validate_srv_data(&$data, $zoneid){
139139
$weight = $fields[0];
140140
$port = $fields[1];
141141
$target = $fields[2];
142-
if($weight < 0 || $weight > 65535) $error .= $app->tform->wordbook['weight_txt']." (\"<i>" . htmlentities($weight)."</i>\") ".$app->tform->wordbook['error_srv_out_of_range']."<br>\r\n";
143-
if ($port < 0 || $port > 65535) $error .= $app->tform->wordbook['port_txt']." (\"<i>".htmlentities($port)."</i>\") ".$app->tform->wordbook['error_srv_out_of_range']."<br>\r\n";
142+
if($weight < 0 || $weight > 65535) $error .= $app->tform->wordbook['weight_txt']." (\"<i>" . htmlentities($weight,ENT_QUOTES,$conf["html_content_encoding"])."</i>\") ".$app->tform->wordbook['error_srv_out_of_range']."<br>\r\n";
143+
if($port < 0 || $port > 65535) $error .= $app->tform->wordbook['port_txt']." (\"<i>".htmlentities($port,ENT_QUOTES,$conf["html_content_encoding"])."</i>\") ".$app->tform->wordbook['error_srv_out_of_range']."<br>\r\n";
144144

145145
$error .= $this->validate_field($target, "SRV target", $zoneid, 0);
146146

0 commit comments

Comments
 (0)