diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-06-05 06:40:25 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-06-05 06:40:25 +0000 |
| commit | 3e2087e7bdc6357c56b4b88574361bc1f7fa372f (patch) | |
| tree | 4e3df5810fa3537975e6f5fbb2e0fdf075121669 /roundcubemail/program/include | |
| parent | 959e5ec57ab04781e2a328f5dcc3d9b7af302013 (diff) | |
- fix bug in last commit
git-svn-id: https://svn.roundcube.net/trunk@2609 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
| -rw-r--r-- | roundcubemail/program/include/main.inc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/roundcubemail/program/include/main.inc b/roundcubemail/program/include/main.inc index 6f1be8526..d46cec2d0 100644 --- a/roundcubemail/program/include/main.inc +++ b/roundcubemail/program/include/main.inc @@ -477,17 +477,6 @@ function rep_specialchars_output($str, $enctype='', $mode='', $newlines=TRUE) return $newlines ? nl2br($out) : $out; } - // encode for javascript use - if ($enctype=='js') - return preg_replace(array("/\r?\n/", "/\r/", '/<\\//'), array('\n', '\n', '<\\/'), strtr($str, $js_rep_table)); - - // encode for plaintext - if ($enctype=='text') - return str_replace("\r\n", "\n", $mode=='remove' ? strip_tags($str) : $str); - - if ($enctype=='url') - return rawurlencode($str); - // if the replace tables for XML and JS are not yet defined if ($js_rep_table===false) { @@ -503,6 +492,17 @@ function rep_specialchars_output($str, $enctype='', $mode='', $newlines=TRUE) $js_rep_table["\\"] = "\\\\"; } + // encode for javascript use + if ($enctype=='js') + return preg_replace(array("/\r?\n/", "/\r/", '/<\\//'), array('\n', '\n', '<\\/'), strtr($str, $js_rep_table)); + + // encode for plaintext + if ($enctype=='text') + return str_replace("\r\n", "\n", $mode=='remove' ? strip_tags($str) : $str); + + if ($enctype=='url') + return rawurlencode($str); + // encode for XML if ($enctype=='xml') return strtr($str, $xml_rep_table); |
