[wp-trac] [WordPress Trac] #20927: Ampersand inside HTML comment causes wp_insert_post to loop infinitely

WordPress Trac wp-trac at lists.automattic.com
Wed Jun 13 19:36:01 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        |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by nacin):

 I was surprised to confirm this, but indeed. The loop occurs in
 wp_kses_named_entities(). The issue is because the global in there is not
 set, and in_array() spins for eternity.

 WordPress is not currently designed to be included from within a function,
 which is your problem, as it sets an awful number of globals, and does not
 make an attempt to ensure that a number of them are indeed operating in
 the global namespace explicitly. If you just include wp-load.php in global
 scope, everything will be fine.

 If you wanted to do this, you can also use something like
 get_defined_vars() and extract everything into the global namespace on
 your own.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20927#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list