I have a few issues, wondered if anyone can help.
The smilie filter has problems where you might have 2 smilies,
i.e.
foo.gif :p
bar.gif :punch
in this case, if someone sends :punch, it will be replaced with the :p smiley, and unch on the end, i.e. <img src="foo.gif">unch
Could anyone tell me how to solve this? I believe the relevent code is here in phpfreechat.class.php:
- Code: Select all
function FilterSmiley($msg)
{
$c =& pfcGlobalConfig::Instance();
// build a preg_replace array
$search = array();
$replace = array();
$query = "/(";
foreach($c->smileys as $s_file => $s_strs)
{
foreach ($s_strs as $s_str)
{
$s_str = stripslashes($s_str); /* the :'( smileys needs this filter */
$query .= preg_quote($s_str,'/')."|";
$search[] = "/".preg_quote($s_str,'/')."/";
$replace[] = '<img src="'.$s_file.'" alt="'.$s_str.'" title="'.$s_str.'" />';
}
}
...
Thanks in advance
Adam