Skip to content

Commit

Permalink
Fix: Infinite loop caused by smiley code with "["
Browse files Browse the repository at this point in the history
Complete error description here:
http://www.flying-bits.org/tracker.php?p=33&t=978
  • Loading branch information
marc1706 committed Jul 30, 2012
1 parent a72b7b7 commit cea6d2b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion root/includes/trim_message/bbcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,8 @@ static public function get_content_length($content)
$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))) != '--')
Expand Down

0 comments on commit cea6d2b

Please sign in to comment.