[wp-testers] RE: wp-testers Digest, Vol 10, Issue 68
Toby Simmons
toby at simmonsconsulting.com
Fri Dec 23 14:40:34 GMT 2005
Right you are, sir.
How about this one (Of course it won't match a malformed comment like this)
<!-- did you know that 3 > 2 -->
Index: wp-includes/kses.php
===================================================================
--- wp-includes/kses.php (revision 3332)
+++ wp-includes/kses.php (working copy)
@@ -98,6 +98,10 @@
return '>';
# It matched a ">" character
+ if (preg_match('%^<!--[^>]*-->$%', $string))
+ return $string;
+ # Allow HTML comments
+
if (!preg_match('%^<\s*(/\s*)?([a-zA-Z0-9]+)([^>]*)>?$%', $string,
$matches))
return '';
# It's seriously malformed
Date: Thu, 22 Dec 2005 17:41:25 -0600
From: Andy Skelton <skeltoac at gmail.com>
Subject: Re: [wp-testers] RE: wp_kses kills <!--more--> tags from
xmlrpc posted entries
To: wp-testers at lists.automattic.com
Message-ID:
<e6ec604d0512221541p7706db39g9cd3d4f94dc566be at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
On 12/22/05, Toby Simmons <toby at simmonsconsulting.com> wrote:
> + if (preg_match('%^<!--[^>-]+-->$%', $string))
This will not match comments such as this:
<!--my-awesome-comment-->
Andy
More information about the wp-testers
mailing list