mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
removed a looped regex
git-svn-id: file:///svn/phpbb/trunk@7743 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
e41b3b8943
commit
de739b6532
1 changed files with 8 additions and 17 deletions
|
@ -1239,28 +1239,19 @@ class parse_message extends bbcode_firstpass
|
||||||
{
|
{
|
||||||
if ($max_smilies)
|
if ($max_smilies)
|
||||||
{
|
{
|
||||||
$count = 0;
|
$num_matches = preg_match_all('#' . str_replace('#', '', implode('|', $match)) . '#', $this->message, $matches);
|
||||||
foreach ($match as $key => $smilie)
|
unset($matches);
|
||||||
{
|
|
||||||
if ($small_count = preg_match_all($smilie, $this->message, $array))
|
if ($num_matches !== false && $num_matches > $max_smilies)
|
||||||
{
|
|
||||||
$count += $small_count;
|
|
||||||
if ($count > $max_smilies)
|
|
||||||
{
|
{
|
||||||
$this->warn_msg[] = sprintf($user->lang['TOO_MANY_SMILIES'], $max_smilies);
|
$this->warn_msg[] = sprintf($user->lang['TOO_MANY_SMILIES'], $max_smilies);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->message = preg_replace($smilie, $replace[$key], $this->message);
|
|
||||||
}
|
|
||||||
$this->message = trim($this->message);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->message = trim(preg_replace($match, $replace, $this->message));
|
$this->message = trim(preg_replace($match, $replace, $this->message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse Attachments
|
* Parse Attachments
|
||||||
|
|
Loading…
Add table
Reference in a new issue