summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-07-28 13:04:40 +0000
committeralecpl <alec@alec.pl>2009-07-28 13:04:40 +0000
commit5dc7c21bdc0eea39202c278f1645f354caac5e4a (patch)
treefdba31fa66ad8abcfe5c8c775d46ccbd7b40da49
parentdaa3f720bc54ad352af35ec015896c9830704c3f (diff)
- Fix charset names with X- prefix handling
-rw-r--r--CHANGELOG1
-rw-r--r--program/include/main.inc8
2 files changed, 5 insertions, 4 deletions
diff --git a/CHANGELOG b/CHANGELOG
index a4f2fc9f5..3250c0d97 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG RoundCube Webmail
===========================
+- Fix charset names with X- prefix handling
- Fix displaying of HTML messages with unknown/malformed tags (#1486003)
RELEASE 0.3-RC1
diff --git a/program/include/main.inc b/program/include/main.inc
index 09b8c78d4..f0201075b 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -309,20 +309,20 @@ function rcube_parse_charset($charset)
'ANSIX31101983' => 'WINDOWS-1252',
'ANSIX341968' => 'WINDOWS-1252',
'UNKNOWN8BIT' => 'ISO-8859-15',
- 'XUNKNOWN' => 'ISO-8859-15',
- 'XUSERDEFINED' => 'ISO-8859-15',
+ 'UNKNOWN' => 'ISO-8859-15',
+ 'USERDEFINED' => 'ISO-8859-15',
'KSC56011987' => 'EUC-KR',
'GB2312' => 'GBK',
'GB231280' => 'GBK',
'UNICODE' => 'UTF-8',
'UTF7IMAP' => 'UTF7-IMAP',
- 'XXBIG5' => 'BIG5',
'TIS620' => 'WINDOWS-874',
'ISO88599' => 'WINDOWS-1254',
'ISO885911' => 'WINDOWS-874',
);
- $str = preg_replace('/[^a-z0-9]/i', '', $charset);
+ // allow a-z and 0-9 only and remove X- prefix (e.g. X-ROMAN8 => ROMAN8)
+ $str = preg_replace(array('/[^a-z0-9]/i', '/^x+/i'), '', $charset);
if (isset($aliases[$str]))
return $aliases[$str];