mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-05 05:55:15 +02:00
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9914 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
66c81cdac4
commit
c748d865b2
@ -1317,7 +1317,7 @@ class parse_message extends bbcode_firstpass
|
|||||||
}
|
}
|
||||||
|
|
||||||
// (assertion)
|
// (assertion)
|
||||||
$match[] = '(?<=^|[\n .])' . preg_quote($row['code'], '#') . '(?![^<>]*>)';
|
$match[] = preg_quote($row['code'], '#');
|
||||||
$replace[] = '<!-- s' . $row['code'] . ' --><img src="{SMILIES_PATH}/' . $row['smiley_url'] . '" alt="' . $row['code'] . '" title="' . $row['emotion'] . '" /><!-- s' . $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);
|
$db->sql_freeresult($result);
|
||||||
@ -1327,7 +1327,7 @@ class parse_message extends bbcode_firstpass
|
|||||||
{
|
{
|
||||||
if ($max_smilies)
|
if ($max_smilies)
|
||||||
{
|
{
|
||||||
$num_matches = preg_match_all('#' . implode('|', $match) . '#', $this->message, $matches);
|
$num_matches = preg_match_all('#(?<=^|[\n .])(?:' . implode('|', $match) . ')(?![^<>]*>)#', $this->message, $matches);
|
||||||
unset($matches);
|
unset($matches);
|
||||||
|
|
||||||
if ($num_matches !== false && $num_matches > $max_smilies)
|
if ($num_matches !== false && $num_matches > $max_smilies)
|
||||||
@ -1338,7 +1338,7 @@ class parse_message extends bbcode_firstpass
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make sure the delimiter # is added in front and at the end of every element within $match
|
// Make sure the delimiter # is added in front and at the end of every element within $match
|
||||||
$this->message = trim(preg_replace(explode(chr(0), '#' . implode('#' . chr(0) . '#', $match) . '#'), $replace, $this->message));
|
$this->message = trim(preg_replace(explode(chr(0), '#(?<=^|[\n .])' . implode('(?![^<>]*>)#' . chr(0) . '#(?<=^|[\n .])', $match) . '(?![^<>]*>)#'), $replace, $this->message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user