1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-01 22:40:39 +02:00

fixing some bugs

git-svn-id: file:///svn/phpbb/trunk@7805 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2007-06-28 14:55:48 +00:00
parent d57a16ad69
commit f9ea21a083
9 changed files with 42 additions and 18 deletions

View File

@@ -1229,7 +1229,7 @@ class parse_message extends bbcode_firstpass
while ($row = $db->sql_fetchrow($result))
{
// (assertion)
$match[] = '#(?<=^|[\n .])' . preg_quote($row['code'], '#') . '(?![^<>]*>)#';
$match[] = '(?<=^|[\n .])' . preg_quote($row['code'], '#') . '(?![^<>]*>)';
$replace[] = '<!-- s' . $row['code'] . ' --><img src="{SMILIES_PATH}/' . $row['smiley_url'] . '" alt="' . $row['code'] . '" title="' . $row['emotion'] . '" /><!-- s' . $row['code'] . ' -->';
}
$db->sql_freeresult($result);
@@ -1239,7 +1239,7 @@ class parse_message extends bbcode_firstpass
{
if ($max_smilies)
{
$num_matches = preg_match_all('#' . str_replace('#', '', implode('|', $match)) . '#', $this->message, $matches);
$num_matches = preg_match_all('#' . implode('|', $match) . '#', $this->message, $matches);
unset($matches);
if ($num_matches !== false && $num_matches > $max_smilies)
@@ -1249,6 +1249,9 @@ class parse_message extends bbcode_firstpass
}
}
// Make sure the delimiter # is added in front and at the end of every element within $match
$match = explode(chr(0), '#' . implode('#' . chr(0) . '#', $match) . '#');
$this->message = trim(preg_replace($match, $replace, $this->message));
}
}