[wp-hackers] comment question

Dougal Campbell dougal at gunters.org
Tue May 16 19:11:29 GMT 2006


Doug Stewart wrote:
> 
> I believe that's likely due to KSES.  What plugins do you have activated?

KSES was my first guess, also. It's probably interpreting it as a 
non-safe tag. This could probably be fixed with a simple plugin that did 
something like...

   function escape_lt($text) {
     $text = preg_replace('/<((?![a-zA-Z]))/', '&lt;$1', $text);
     return $text;
   }

   // Add filter at priority 9, so it runs before KSES
   add_filter('pre_comment_content', 'escape_lt', 9);

That should escape any stand-alone '<' characters (which aren't part of 
tags) before KSES sees them.

-- 
Dougal Campbell <dougal at gunters.org>
http://dougal.gunters.org/



More information about the wp-hackers mailing list