filter html before anything else

git-svn-id: file:///home/shish/svn/shimmie2/trunk@694 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2008-01-12 07:44:08 +00:00
parent 52bdd38cfd
commit 0e4e5f02c8
2 changed files with 4 additions and 7 deletions

View file

@ -223,9 +223,10 @@ class TextFormattingEvent extends Event {
var $stripped;
public function TextFormattingEvent($text) {
$this->original = $text;
$this->formatted = $text;
$this->stripped = $text;
$h_text = html_escape(trim($text));
$this->original = $h_text;
$this->formatted = $h_text;
$this->stripped = $h_text;
}
}

View file

@ -9,8 +9,6 @@ class BBCode extends Extension {
}
private function bbcode_to_html($text) {
$text = trim($text);
$text = html_escape($text);
$text = preg_replace("/\[b\](.*?)\[\/b\]/s", "<b>\\1</b>", $text);
$text = preg_replace("/\[i\](.*?)\[\/i\]/s", "<i>\\1</i>", $text);
$text = preg_replace("/\[u\](.*?)\[\/u\]/s", "<u>\\1</u>", $text);
@ -36,8 +34,6 @@ class BBCode extends Extension {
}
private function bbcode_to_text($text) {
$text = trim($text);
$text = html_escape($text);
$text = preg_replace("/\[b\](.*?)\[\/b\]/s", "\\1", $text);
$text = preg_replace("/\[i\](.*?)\[\/i\]/s", "\\1", $text);
$text = preg_replace("/\[u\](.*?)\[\/u\]/s", "\\1", $text);