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

WordPress Trac noreply at wordpress.org
Wed Sep 16 16:28:17 UTC 2015


#33837: We should avoid Superglobals when possible
-------------------------------------+-----------------------------
 Reporter:  wonderboymusic           |       Owner:  wonderboymusic
     Type:  enhancement              |      Status:  assigned
 Priority:  normal                   |   Milestone:  4.4
Component:  General                  |     Version:
 Severity:  major                    |  Resolution:
 Keywords:  needs-patch 2nd-opinion  |     Focuses:
-------------------------------------+-----------------------------

Comment (by SergeyBiryukov):

 Replying to [comment:13 kitchin]:
 > I'm working on a follow-up patch. The original commit has one actual
 bug:
 > {{{
 > -             if ( isset( $_REQUEST['action'] ) && isset(
 $_REQUEST['delete_tags'] ) && ( 'delete' == $_REQUEST['action'] ||
 'delete' == $_REQUEST['action2'] ) )
 > +             $action = wp_validate_action();
 > +             if ( $action && isset( $_REQUEST['delete_tags'] ) && (
 'delete' == $action || 'delete' == $_REQUEST['action2'] ) )
 > }}}
 > The `isset( $_REQUEST['action'] )` is just there to detect the first
 bulk <select>. It can be empty, as long as the second <select> is truthy.

 It's not empty though,
 [https://core.trac.wordpress.org/browser/tags/4.3.1/src/wp-admin/includes
 /class-wp-list-table.php#L438 the default value is -1]. I could not
 reproduce the issue,

 I would suggest `wp_is_request_value( $field, $value = null )` for the
 function name. Otherwise, [attachment:33837.stringish.diff] looks good to
 me.

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


More information about the wp-trac mailing list