From 1b91daa2faf99c9b9fddc69ab538e9ac5ed471d2 Mon Sep 17 00:00:00 2001
From: redray <redray@ispconfig3>
Date: Sun, 30 Nov 2008 18:28:53 -0500
Subject: [PATCH] fixed the utf-8 problem in all lists
---
interface/lib/classes/validate_dns.inc.php | 4 ++--
interface/lib/classes/listform.inc.php | 10 ++++++----
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/interface/lib/classes/listform.inc.php b/interface/lib/classes/listform.inc.php
index 2c1ef02..31086e8 100644
--- a/interface/lib/classes/listform.inc.php
+++ b/interface/lib/classes/listform.inc.php
@@ -276,6 +276,7 @@
public function decode($record)
{
+ global $conf;
if(is_array($record)) {
foreach($this->listDef['item'] as $field){
$key = $field['field'];
@@ -283,7 +284,7 @@
switch ($field['datatype']){
case 'VARCHAR':
case 'TEXT':
- $record[$key] = htmlentities(stripslashes($record[$key]));
+ $record[$key] = htmlentities(stripslashes($record[$key]),ENT_QUOTES,$conf["html_content_encoding"]);
break;
case 'DATE':
@@ -295,7 +296,7 @@
break;
case 'DOUBLE':
- $record[$key] = htmlentities($record[$key]);
+ $record[$key] = htmlentities($record[$key],ENT_QUOTES,$conf["html_content_encoding"]);
break;
case 'CURRENCY':
@@ -303,7 +304,7 @@
break;
default:
- $record[$key] = htmlentities(stripslashes($record[$key]));
+ $record[$key] = htmlentities(stripslashes($record[$key]),ENT_QUOTES,$conf["html_content_encoding"]);
}
}
}
@@ -362,11 +363,12 @@
}
function escapeArrayValues($search_values) {
+ global $conf;
$out = array();
if(is_array($search_values)) {
foreach($search_values as $key => $val) {
- $out[$key] = htmlentities($val,ENT_QUOTES);
+ $out[$key] = htmlentities($val,ENT_QUOTES,$conf["html_content_encoding"]);
}
}
diff --git a/interface/lib/classes/validate_dns.inc.php b/interface/lib/classes/validate_dns.inc.php
index a161510..938a8fa 100644
--- a/interface/lib/classes/validate_dns.inc.php
+++ b/interface/lib/classes/validate_dns.inc.php
@@ -139,8 +139,8 @@
$weight = $fields[0];
$port = $fields[1];
$target = $fields[2];
- 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";
- 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";
+ 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";
+ 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";
$error .= $this->validate_field($target, "SRV target", $zoneid, 0);
--
Gitblit v1.9.1