Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] <) and >) converted to smilies [R] [C-Michael83]
#2
We replace < and > with &lt; and &gt; so when you do that it sees &lt;) and &gt;) 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


Messages In This Thread
RE: <) and >) converted to smilies - by Ryan Gordon - 2008-10-20, 04:23 PM
RE: <) and >) converted to smilies - by Nexus - 2008-10-25, 08:54 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)