Merge pull request #88 from marc1706/master

Fix: Infinite loop caused by smiley code with "["
This commit is contained in:
Marc Alexander
2012-07-30 13:01:17 -07:00

View File

@@ -364,7 +364,8 @@ class phpbb_trim_message_bbcodes
$content_length = utf8_strlen($content);
$last_smiley = false;
$last_html_opening = $last_html_closing = 0;
while (($last_html_opening = utf8_strpos($content, '<', $last_html_closing)) !== false)
while (($last_html_opening = utf8_strpos($content, '<', $last_html_closing)) !== false &&
utf8_strpos($content, '>', $last_html_opening) !== false)
{
$last_html_closing = utf8_strpos($content, '>', $last_html_opening);
if (($smiley_code = utf8_substr($content, $last_html_opening + 7, ($last_html_closing - $last_html_opening - 11))) != '--')