diff options
author | David M <davidmj@users.sourceforge.net> | 2006-08-17 01:15:01 +0000 |
---|---|---|
committer | David M <davidmj@users.sourceforge.net> | 2006-08-17 01:15:01 +0000 |
commit | e6be1795caa1279bd87acf1c92c19f2c4636f279 (patch) | |
tree | 1398b0b8e4973c664fac84ffacaf3ed6ed20e276 /phpBB/includes/message_parser.php | |
parent | 481f090a39a49b8baaf9c7f0626872eced1b63f4 (diff) | |
download | forums-e6be1795caa1279bd87acf1c92c19f2c4636f279.tar forums-e6be1795caa1279bd87acf1c92c19f2c4636f279.tar.gz forums-e6be1795caa1279bd87acf1c92c19f2c4636f279.tar.bz2 forums-e6be1795caa1279bd87acf1c92c19f2c4636f279.tar.xz forums-e6be1795caa1279bd87acf1c92c19f2c4636f279.zip |
*** empty log message ***
git-svn-id: file:///svn/phpbb/trunk@6294 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/message_parser.php')
-rw-r--r-- | phpBB/includes/message_parser.php | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 02ac41d503..9ce4c1d6da 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -62,25 +62,14 @@ class bbcode_firstpass extends bbcode } else { - // TODO: Review this - $found = false; foreach ($bbcode_data['regexp'] as $regexp => $replacement) { - if (!$found) - { - $before = strlen($this->message); - } - $this->message = preg_replace($regexp, $replacement, $this->message); - if (!$found) + // The pattern gets compiled and cached by the PCRE extension, + // it should not demand recompilation + if (preg_match($regexp, $this->message)) { - $after = strlen($this->message); - if ($before != $after) - { - // Because we add bbcode_uid to all tags, the message length - // will increase whenever a tag is found - $bitfield->set($bbcode_data['bbcode_id']); - $found = true; - } + $this->message = preg_replace($regexp, $replacement, $this->message); + $bitfield->set($bbcode_data['bbcode_id']); } } } |