From: Gabriel Wicke Date: Fri, 9 Apr 2004 16:22:12 +0000 (+0000) Subject: some cleanup on save X-Git-Tag: 1.3.0beta1~510 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=90804e0d92b625211e83041c8224f7f7dfd9b657;p=lhc%2Fweb%2Fwiklou.git some cleanup on save --- diff --git a/includes/Parser.php b/includes/Parser.php index 3c7b67a45e..eb3c613d84 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -1786,7 +1786,16 @@ class Parser } $stripState = false; - $text = str_replace("\r\n", "\n", $text); + $pairs = array( + "\r\n" => "\n", + ); + $text = str_replace(array_keys($pairs), array_values($pairs), $text); + // now with regexes + $pairs = array( + "//i" => '
', + "/
/i" => "
", + ); + $text = preg_replace(array_keys($pairs), array_values($pairs), $text); $text = $this->strip( $text, $stripState, false ); $text = $this->pstPass2( $text, $user ); $text = $this->unstrip( $text, $stripState );