[wp-trac] [WordPress Trac] #22325: Abstract GPCS away from the superglobals

WordPress Trac noreply at wordpress.org
Sun Oct 4 03:29:47 UTC 2015


#22325: Abstract GPCS away from the superglobals
-----------------------------------+-----------------------------
 Reporter:  rmccue                 |       Owner:
     Type:  enhancement            |      Status:  new
 Priority:  normal                 |   Milestone:  Future Release
Component:  Bootstrap/Load         |     Version:
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:
-----------------------------------+-----------------------------
Changes (by MikeSchinkel):

 * keywords:  has-patch needs-refresh => has-patch 2nd-opinion


Comment:

 Added an updated version of @mccue's last patch that made the static vars
 private.  Also added in `$_COOKIE` and `$_SERVER` vars and methods.

 However, before uploading the patch I started to worry that we can
 possibly be creating two sources of truth for the superglobals and would
 like to get other people's take on it.  This could become a concern if a
 plugin changes one of the superglobals in a manner similar to how
 WordPress does during boot/load.

 We may want to add a filter to each of the access methods in my path so
 that a plugin can ensure the values are in sync, if needed.  Or maybe we
 want to avoid the private variables and have the methods do a
 `stripslashes_deep()` on the superglobals?  Or...maybe something else?

 Or maybe this patch is sufficient?

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


More information about the wp-trac mailing list