2008-10-20, 12:38 PM
2008-10-20, 04:23 PM
We replace < and > with < and > so when you do that it sees <) and >) and it matches the ";)" part which is causing the problem. I guess we just fix the code to correctly check if there is a preceding html entity before
if(is_array($this->smilies_cache))
{
foreach($this->smilies_cache as $find => $replace)
{
$find = $this->parse_html($find);
if(version_compare(PHP_VERSION, "5.1.0", ">="))
{
$message = preg_replace("#(?<=[^&;\"])".preg_quote($find,"#")."(?=.\W|\"|\W.|\W$)#si", $replace, $message, $remaining, $replacements);
$remaining -= $replacements;
if($remaining <= 0)
{
break; // Reached the limit
}
}
else
{
$message = preg_replace("#(?<=[^&;\"])".preg_quote($find,"#")."(?=.\W|\"|\W.|\W$)#si", $replace, $message, $remaining);
}
}
}
inc/class_parser.php
2008-10-25, 08:54 PM
I don't see the problem in this to be honest.......unless u want to show a pizza slice, u wont post < ) and it wont make it <)
2008-10-26, 03:29 AM
I could be doing....
(i.e. </html>)
2008-10-31, 01:56 AM
Thank you for your bug report.
This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.
With regards,
MyBB Group
This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.
With regards,
MyBB Group
2008-10-31, 01:56 AM
Find in inc/class_parser.php
and replace with
if(version_compare(PHP_VERSION, "5.1.0", ">="))
{
$message = preg_replace("#(?<=[^&;\"])".preg_quote($find,"#")."(?=.\W|\"|\W.|\W$)#si", $replace, $message, $remaining, $replacements);
$remaining -= $replacements;
if($remaining <= 0)
{
break; // Reached the limit
}
}
else
{
$message = preg_replace("#(?<=[^&;\"])".preg_quote($find,"#")."(?=.\W|\"|\W.|\W$)#si", $replace, $message, $remaining);
}
and replace with
$find = preg_quote($find, "#");
// Fix issues for smileys starting with a ";"
if($find{0} == ";")
{
$find = "(?<!>|<|&)".$find;
}
if(version_compare(PHP_VERSION, "5.1.0", ">="))
{
$message = preg_replace("#(?<=[^\"])".$find."(?=.\W|\"|\W.|\W$)#si", $replace, $message, $remaining, $replacements);
$remaining -= $replacements;
if($remaining <= 0)
{
break; // Reached the limit
}
}
else
{
$message = preg_replace("#(?<=[^\"])".$find."(?=.\W|\"|\W.|\W$)#si", $replace, $message, $remaining);
}