[wp-trac] [WordPress Trac] #37731: Infinite loop in _wp_json_sanity_check() during plugin install (was: Fatal error: Maximum function nesting level of '256' reached, aborting! in /home/user/www/wordpress/hdocs/wp-includes/functions.php on line 2992)

WordPress Trac noreply at wordpress.org
Fri Aug 19 19:02:06 UTC 2016


#37731: Infinite loop in _wp_json_sanity_check() during plugin install
--------------------------+------------------------------
 Reporter:  maestrosite   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Plugins       |     Version:  4.6
 Severity:  normal        |  Resolution:
 Keywords:  dev-feedback  |     Focuses:  administration
--------------------------+------------------------------

Comment (by swissspidy):

 So… after a successful install or update, `wp_update_plugins()`gets
 called.
 That function runs `wp_json_encode( $extra_stats )`, where `$extra_stats`
 is the argument passed to the function.
 `wp_json_encode()` runs `_wp_json_sanity_check()` and the infinite loop
 begins. But as it is a recursive function, it has a proper termination
 condition (decrementing `$depth`)

 Since you guys seem to be able to reproduce this issue, could you try
 adding a `var_dump( $extra_stats )` right before the
 `wp_json_encode()`line in `wp_update_plugins()` (line 297)? Maybe a value
 is passed by reference or something like that, which makes the function
 call itself hundreds of times.

 There was only one change to `wp_json_encode()` in 4.6, see [37444].
 `_wp_json_sanity_check()` hasn't been touched.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37731#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list