[wp-trac] [WordPress Trac] #20927: Ampersand inside HTML comment causes wp_insert_post to loop infinitely
WordPress Trac
wp-trac at lists.automattic.com
Tue Jun 12 19:54:46 UTC 2012
#20927: Ampersand inside HTML comment causes wp_insert_post to loop infinitely
--------------------------+-----------------------------
Reporter: jpayette | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 3.3.2
Severity: normal | Keywords:
--------------------------+-----------------------------
I'm encountering an issue with wp_insert_post where, when the post_content
contains an HTML comment containing an ampersand (ie, "<!-- & -->"),
wp_insert_post seems to be getting stuck in an infinite loop. As far as I
can tell, it is endless escaping the & into & over and over.
I've attached a small script that reproduces this error; you need to
replace the HTTP_HOST and the path to wp-load.php to reflect your own
machine for it to run. I've reproduced this issue on two different
machines, both running Ubuntu 12.04, one on Wordpress 3.3.1 and the other
on Wordpress 3.3.2.
The most bizarre thing about this issue, to me, is if you move the
contents of the includeFiles() function out of the function and into the
main body of the script, the issue no longer occurs. Somehow, including
wp-load.php from a function is causing the infinite loop.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20927>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list