From ff509e3a036a75f03c975f5b8adedc0a1f639b4f Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sun, 7 Oct 2007 10:34:45 +0000 Subject: - Match custom BBCodes in the same way during first and second pass - patch provided by IBBoard [Bug #14268] git-svn-id: file:///svn/phpbb/trunk@8153 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/bbcode.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'phpBB/includes/bbcode.php') diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index 6610a5c441..ef73762582 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -80,6 +80,7 @@ class bbcode $bitfield = new bitfield($this->bbcode_bitfield); $bbcodes_set = $bitfield->get_all_set(); + $undid_bbcode_specialchars = false; foreach ($bbcodes_set as $bbcode_id) { if (!empty($this->bbcode_cache[$bbcode_id])) @@ -100,6 +101,14 @@ class bbcode if (sizeof($preg['search'])) { + // we need to turn the entities back into their original form to allow the + // search patterns to work properly + if (!$undid_bbcode_specialchars) + { + $message = str_replace(array(':', '.'), array(':', '.'), $message); + $undid_bbcode_specialchars = true; + } + $message = preg_replace($preg['search'], $preg['replace'], $message); $preg = array('search' => array(), 'replace' => array()); } -- cgit v1.2.1