1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-25 04:24:31 +02:00

Trim emoticon preg

git-svn-id: file:///svn/phpbb/trunk@4490 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen
2003-09-09 01:01:34 +00:00
parent 6f96492dd9
commit 7b037d5e42

View File

@ -645,8 +645,8 @@ class parse_message
do
{
$match[] = '#(' . preg_quote($row['code'], '#') . ')#';
// $match[] = "#(?<=.\W|\W.|^\W)" . preg_quote($row['code'], '#') . "(?=.\W|\W.|\W$)#";
// $match[] = '#(' . preg_quote($row['code'], '#') . ')#';
$match[] = "#(?<=.\W|\W.|^\W)" . preg_quote($row['code'], '#') . "(?=.\W|\W.|\W$)#";
$replace[] = '<!-- s' . $row['code'] . ' --><img src="{SMILE_PATH}/' . $row['smile_url'] . '" border="0" alt="' . $row['emoticon'] . '" title="' . $row['emoticon'] . '" /><!-- s' . $row['code'] . ' -->';
}
while ($row = $db->sql_fetchrow($result));
@ -662,7 +662,7 @@ class parse_message
}
}
$this->message = preg_replace($match, $replace, ' ' . $this->message . ' ');
$this->message = trim(preg_replace($match, $replace, ' ' . $this->message . ' '));
}
}