Make WordPress Core

Ticket #39186: 39186.3.patch

File 39186.3.patch, 7.3 KB (added by chris_dev, 7 years ago)

Hi, I found an issue on the plugin page so I added it up.

  • wp-admin/includes/class-wp-list-table.php

     
    470470
    471471                echo "</select>\n";
    472472
    473                 submit_button( __( 'Apply' ), 'action', '', false, array( 'id' => "doaction$two" ) );
     473                submit_button( __( 'Apply' ), 'action', '', false, array( 'id' => "doaction$two", 'name' => "doaction$two" ) );
    474474                echo "\n";
    475475        }
    476476
     
    486486                if ( isset( $_REQUEST['filter_action'] ) && ! empty( $_REQUEST['filter_action'] ) )
    487487                        return false;
    488488
    489                 if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] )
     489                if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] && isset($_REQUEST['doaction']) )
    490490                        return $_REQUEST['action'];
    491491
    492                 if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] )
     492                if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] && isset($_REQUEST['doaction2']) )
    493493                        return $_REQUEST['action2'];
    494494
    495495                return false;
  • wp-admin/includes/class-wp-plugins-list-table.php

     
    601601                                if ( $is_active ) {
    602602                                        if ( current_user_can( 'manage_network_plugins' ) ) {
    603603                                                /* translators: %s: plugin name */
    604                                                 $actions['deactivate'] = '<a href="' . wp_nonce_url( 'plugins.php?action=deactivate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'deactivate-plugin_' . $plugin_file ) . '" aria-label="' . esc_attr( sprintf( _x( 'Network Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Network Deactivate' ) . '</a>';
     604                                                $actions['deactivate'] = '<a href="' . wp_nonce_url( 'plugins.php?action=deactivate&amp;doaction&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'deactivate-plugin_' . $plugin_file ) . '" aria-label="' . esc_attr( sprintf( _x( 'Network Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Network Deactivate' ) . '</a>';
    605605                                                }
    606606                                } else {
    607607                                        if ( current_user_can( 'manage_network_plugins' ) ) {
    608608                                                /* translators: %s: plugin name */
    609                                                 $actions['activate'] = '<a href="' . wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file ) . '" class="edit" aria-label="' . esc_attr( sprintf( _x( 'Network Activate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Network Activate' ) . '</a>';
     609                                                $actions['activate'] = '<a href="' . wp_nonce_url( 'plugins.php?action=activate&amp;doaction&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file ) . '" class="edit" aria-label="' . esc_attr( sprintf( _x( 'Network Activate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Network Activate' ) . '</a>';
    610610                                        }
    611611                                        if ( current_user_can( 'delete_plugins' ) && ! is_plugin_active( $plugin_file ) ) {
    612612                                                /* translators: %s: plugin name */
     
    624624                                        );
    625625                                } elseif ( $is_active ) {
    626626                                        /* translators: %s: plugin name */
    627                                         $actions['deactivate'] = '<a href="' . wp_nonce_url( 'plugins.php?action=deactivate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'deactivate-plugin_' . $plugin_file ) . '" aria-label="' . esc_attr( sprintf( _x( 'Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Deactivate' ) . '</a>';
     627                                        $actions['deactivate'] = '<a href="' . wp_nonce_url( 'plugins.php?action=deactivate&amp;doaction&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'deactivate-plugin_' . $plugin_file ) . '" aria-label="' . esc_attr( sprintf( _x( 'Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Deactivate' ) . '</a>';
    628628                                } else {
    629629                                        /* translators: %s: plugin name */
    630                                         $actions['activate'] = '<a href="' . wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file ) . '" class="edit" aria-label="' . esc_attr( sprintf( _x( 'Activate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Activate' ) . '</a>';
     630                                        $actions['activate'] = '<a href="' . wp_nonce_url( 'plugins.php?action=activate&amp;doaction&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file ) . '" class="edit" aria-label="' . esc_attr( sprintf( _x( 'Activate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Activate' ) . '</a>';
    631631
    632632                                        if ( ! is_multisite() && current_user_can( 'delete_plugins' ) ) {
    633633                                                /* translators: %s: plugin name */
  • wp-admin/includes/class-wp-terms-list-table.php

     
    164164         * @return string
    165165         */
    166166        public function current_action() {
    167                 if ( isset( $_REQUEST['action'] ) && isset( $_REQUEST['delete_tags'] ) && ( 'delete' === $_REQUEST['action'] || 'delete' === $_REQUEST['action2'] ) )
     167                if ( isset( $_REQUEST['delete_tags'] ) && (
     168                                ( isset( $_REQUEST['doaction'] ) && 'delete' == $_REQUEST['action'] ) ||
     169                                ( isset( $_REQUEST['doaction2'] ) && 'delete' == $_REQUEST['action2'] )
     170                        ) ) {
    168171                        return 'bulk-delete';
     172                }
    169173
    170174                return parent::current_action();
    171175        }
  • wp-admin/includes/class-wp-users-list-table.php

     
    267267                        <?php wp_dropdown_roles(); ?>
    268268                </select>
    269269        <?php
    270                         submit_button( __( 'Change' ), '', 'changeit', false );
     270                        $submit_name = 'bottom' === $which ? 'changeit2' : 'changeit';
     271                        submit_button( __( 'Change' ), '', $submit_name, false );
    271272                endif;
    272273
    273274                /**
     
    295296         * @return string The bulk action required.
    296297         */
    297298        public function current_action() {
    298                 if ( isset( $_REQUEST['changeit'] ) &&
    299                         ( ! empty( $_REQUEST['new_role'] ) || ! empty( $_REQUEST['new_role2'] ) ) ) {
     299                if ( ( isset( $_REQUEST['changeit'] ) && ! empty( $_REQUEST['new_role'] ) ) || ( isset( $_REQUEST['changeit2'] ) && ! empty( $_REQUEST['new_role2'] ) ) ) {
    300300                        return 'promote';
    301301                }
    302302
  • wp-admin/users.php

     
    103103
    104104        $editable_roles = get_editable_roles();
    105105        $role = false;
    106         if ( ! empty( $_REQUEST['new_role2'] ) ) {
     106        if ( isset( $_REQUEST['changeit2'] ) && ! empty( $_REQUEST['new_role2'] ) ) {
    107107                $role = $_REQUEST['new_role2'];
    108         } elseif ( ! empty( $_REQUEST['new_role'] ) ) {
     108        } elseif ( isset( $_REQUEST['changeit'] ) && ! empty( $_REQUEST['new_role'] ) ) {
    109109                $role = $_REQUEST['new_role'];
    110110        }
    111111