Changeset 2608 in subversion
- Timestamp:
- Jun 5, 2009 2:08:46 AM (4 years ago)
- Location:
- trunk/roundcubemail/program/include
- Files:
-
- 2 edited
-
main.inc (modified) (4 diffs)
-
rcmail.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/main.inc
r2603 r2608 446 446 static $xml_rep_table = false; 447 447 448 $charset = rcmail::get_instance()->config->get('charset', RCMAIL_CHARSET);449 $is_iso_8859_1 = false;450 if ($charset == 'ISO-8859-1') {451 $is_iso_8859_1 = true;452 }453 448 if (!$enctype) 454 449 $enctype = $OUTPUT->type; 455 456 // encode for plaintext457 if ($enctype=='text')458 return str_replace("\r\n", "\n", $mode=='remove' ? strip_tags($str) : $str);459 450 460 451 // encode for HTML output … … 487 478 } 488 479 480 // encode for javascript use 481 if ($enctype=='js') 482 return preg_replace(array("/\r?\n/", "/\r/", '/<\\//'), array('\n', '\n', '<\\/'), strtr($str, $js_rep_table)); 483 484 // encode for plaintext 485 if ($enctype=='text') 486 return str_replace("\r\n", "\n", $mode=='remove' ? strip_tags($str) : $str); 487 489 488 if ($enctype=='url') 490 489 return rawurlencode($str); … … 497 496 498 497 for ($c=160; $c<256; $c++) // can be increased to support more charsets 499 {500 498 $xml_rep_table[Chr($c)] = "&#$c;"; 501 502 if ($is_iso_8859_1)503 $js_rep_table[Chr($c)] = sprintf("\\u%04x", $c);504 }505 499 506 500 $xml_rep_table['"'] = '"'; … … 513 507 if ($enctype=='xml') 514 508 return strtr($str, $xml_rep_table); 515 516 // encode for javascript use517 if ($enctype=='js')518 {519 if ($charset!='UTF-8')520 $str = rcube_charset_convert($str, RCMAIL_CHARSET, $charset);521 522 return preg_replace(array("/\r?\n/", "/\r/", '/<\\//'), array('\n', '\n', '<\\/'), strtr($str, $js_rep_table));523 }524 509 525 510 // no encoding given -> return original string -
trunk/roundcubemail/program/include/rcmail.php
r2493 r2608 322 322 $this->output->set_env('action', $this->action); 323 323 $this->output->set_env('comm_path', $this->comm_path); 324 $this->output->set_charset( $this->config->get('charset', RCMAIL_CHARSET));324 $this->output->set_charset(RCMAIL_CHARSET); 325 325 326 326 // add some basic label to client
Note: See TracChangeset
for help on using the changeset viewer.
