summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2015-01-03 03:04:01 +0100
committerBenny Baumann <BenBE@geshi.org>2015-01-03 03:04:01 +0100
commit3324a701310a6fa2f12b6652ed2d6646a00abc99 (patch)
tree063d5a8db7366829c28a0808a9ec1c870e709a42
parentde351d13cf6ccf7b2070c1693c0cff5eabd964c7 (diff)
downloadcacert-devel-3324a701310a6fa2f12b6652ed2d6646a00abc99.tar.gz
cacert-devel-3324a701310a6fa2f12b6652ed2d6646a00abc99.tar.xz
cacert-devel-3324a701310a6fa2f12b6652ed2d6646a00abc99.zip
bug 1354: Avoid a warning with htmlentities not knowing the charset detected
-rw-r--r--www/gpg.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/www/gpg.php b/www/gpg.php
index 70db756..5a73e32 100644
--- a/www/gpg.php
+++ b/www/gpg.php
@@ -322,7 +322,7 @@ function normalizeName($name) {
//Enhanced version of SanitizeHTML which is charset-aware for UTF-8 + ISO-8859-1
$charset = mb_detect_encoding($name, "auto, ISO-8859-1, UTF-8", true);
- if(false === $charset) {
+ if(false === $charset || !in_array($charset, array('UTF-8', 'ISO-8859-1', 'ISO-8859-15', 'cp1251', 'cp1252', 'KOI8-R', 'BIG5', 'GB2312', 'BIG5-HKSCS', 'Shift_JIS', 'EUC-JP')) ) {
$charset = 'ISO-8859-1';
}
$name = htmlentities($name, ENT_QUOTES, $charset, false);