Changeset 3951 in subversion
- Timestamp:
- Sep 9, 2010 7:34:35 AM (3 years ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 2 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/main.inc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/CHANGELOG
r3949 r3951 20 20 - Added fieldsets in Identity form, added 'identity_form' hook 21 21 - Re-added 'Close' button in upload form (#1486930, #1486823) 22 - Fix handling of charsets with LATIN-* label 22 23 23 24 RELEASE 0.4 -
trunk/roundcubemail/program/include/main.inc
r3946 r3951 335 335 336 336 $charset = preg_replace(array( 337 '/^[^0-9A-Z]+/', // e.g. _ISO-8859-JP$SIO 338 '/\$.*$/', // e.g. _ISO-8859-JP$SIO 339 '/UNICODE-1-1-*/', // RFC1641/1642 337 '/^[^0-9A-Z]+/', // e.g. _ISO-8859-JP$SIO 338 '/\$.*$/', // e.g. _ISO-8859-JP$SIO 339 '/UNICODE-1-1-*/', // RFC1641/1642 340 '/^X-/', // X- prefix (e.g. X-ROMAN8 => ROMAN8) 340 341 ), '', $charset); 341 342 … … 368 369 ); 369 370 370 // allow a-z and 0-9 only and remove X- prefix (e.g. X-ROMAN8 => ROMAN8)371 $str = preg_replace( array('/[^A-Z0-9]/', '/^X+/'), '', $charset);371 // allow A-Z and 0-9 only 372 $str = preg_replace('/[^A-Z0-9]/', '', $charset); 372 373 373 374 if (isset($aliases[$str])) … … 386 387 else if (preg_match('/(WIN|WINDOWS)([0-9]+)/', $str, $m)) { 387 388 $result = 'WINDOWS-' . $m[2]; 389 } 390 // LATIN 391 else if (preg_match('/(CSISOLATIN|LATIN)(.*)/', $str, $m)) { 392 $aliases = array('2' => 2, '3' => 3, '4' => 4, '5' => 9, '6' => 10, 393 '7' => 13, '8' => 14, '9' => 15, '10' => 16, 394 'ARABIC' => 6, 'CYRILLIC' => 5, 'GREEK' => 7, 'HEBREW' => 8); 395 396 // some clients sends windows-1252 text as latin1, 397 // it is safe to use windows-1252 for all latin1 398 if ($m[2] == 1) { 399 $result = 'WINDOWS-1252'; 400 } 401 // if iconv is not supported we need ISO labels, it's also safe for iconv 402 else if (!empty($aliases[$m[2]])) { 403 $result = 'ISO-8859-'.$aliases[$m[2]]; 404 } 405 // iconv requires convertion of e.g. LATIN-1 to LATIN1 406 else { 407 $result = $str; 408 } 388 409 } 389 410 else {
Note: See TracChangeset
for help on using the changeset viewer.
