[wp-trac] [WordPress Trac] #33837: We should avoid Superglobals when possible

WordPress Trac noreply at wordpress.org
Fri Sep 11 21:07:47 UTC 2015


#33837: We should avoid Superglobals when possible
----------------------------+--------------------
 Reporter:  wonderboymusic  |       Owner:
     Type:  enhancement     |      Status:  new
 Priority:  normal          |   Milestone:  4.4
Component:  General         |     Version:  trunk
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:
----------------------------+--------------------

Comment (by wonderboymusic):

 In [changeset:"34059"]:
 {{{
 #!CommitTicketReference repository="" revision="34059"
 Introduce `wp_validate_action( $action = '' )`, a helper function that
 checks `$_REQUEST` for `action` and returns it, or empty string if not
 present. If `$action` is passed, it checks to make sure they match before
 returning it, or an empty string. Strings are always returned to avoid
 returning multiple types.

 Implementing this removes 27 uses of direct superglobal access in the
 admin.

 For more reading:
 https://codeclimate.com/github/WordPress/WordPress/wp-admin/edit-
 comments.php

 See #33837.
 }}}

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


More information about the wp-trac mailing list