diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-07-28 13:04:40 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-07-28 13:04:40 +0000 |
| commit | 37382be4c8cda653b3cbf1ac8dc8f67370abb69b (patch) | |
| tree | c18afa837e71ed23993a6290dd59ecbde24d7ce5 /roundcubemail/program/include | |
| parent | 7c0e06c7f6ac281ae96ef75728713011dda7e321 (diff) | |
- Fix charset names with X- prefix handling
git-svn-id: https://svn.roundcube.net/trunk@2804 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
| -rw-r--r-- | roundcubemail/program/include/main.inc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/roundcubemail/program/include/main.inc b/roundcubemail/program/include/main.inc index 09b8c78d4..f0201075b 100644 --- a/roundcubemail/program/include/main.inc +++ b/roundcubemail/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]; |
