From 74eb6c3ceb214d816a679fb6c99495bd8c192f80 Mon Sep 17 00:00:00 2001 From: alecpl <alec@alec.pl> Date: Fri, 05 Jun 2009 02:40:25 -0400 Subject: [PATCH] - fix bug in last commit --- program/include/main.inc | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/program/include/main.inc b/program/include/main.inc index 6f1be85..d46cec2 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -477,17 +477,6 @@ 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 @@ $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); -- Gitblit v1.9.1