Make WordPress Core

Changeset 29782


Ignore:
Timestamp:
09/29/2014 04:53:07 AM (10 years ago)
Author:
wonderboymusic
Message:

In the form handler logic for edit-tags.php, don't redirect until $_REQUEST['paged'] has been checked. All switch cases (except edit) now use break instead of exit.

Fixes #16162.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-tags.php

    r28291 r29782  
    3939add_screen_option( 'per_page', array( 'label' => $title, 'default' => 20, 'option' => 'edit_' . $tax->name . '_per_page' ) );
    4040
     41$location = false;
     42
    4143switch ( $wp_list_table->current_action() ) {
    4244
     
    6264    else
    6365        $location = add_query_arg( 'message', 4, $location );
    64     wp_redirect( $location );
    65     exit;
     66
     67    break;
    6668
    6769case 'delete':
     
    7476    }
    7577
    76     if ( !isset( $_REQUEST['tag_ID'] ) ) {
    77         wp_redirect( $location );
    78         exit;
     78    if ( ! isset( $_REQUEST['tag_ID'] ) ) {
     79        break;
    7980    }
    8081
     
    8889
    8990    $location = add_query_arg( 'message', 2, $location );
    90     wp_redirect( $location );
    91     exit;
     91
     92    break;
    9293
    9394case 'bulk-delete':
     
    111112
    112113    $location = add_query_arg( 'message', 6, $location );
    113     wp_redirect( $location );
    114     exit;
     114
     115    break;
    115116
    116117case 'edit':
     
    124125    require_once( ABSPATH . 'wp-admin/admin-header.php' );
    125126    include( ABSPATH . 'wp-admin/edit-tag-form.php' );
    126 
    127 break;
     127    include( ABSPATH . 'wp-admin/admin-footer.php' );
     128
     129    exit;
    128130
    129131case 'editedtag':
     
    153155    else
    154156        $location = add_query_arg( 'message', 5, $location );
    155 
    156     wp_redirect( $location );
    157     exit;
    158 
    159 default:
    160 if ( ! empty($_REQUEST['_wp_http_referer']) ) {
     157    break;
     158}
     159
     160if ( ! $location && ! empty( $_REQUEST['_wp_http_referer'] ) ) {
    161161    $location = remove_query_arg( array('_wp_http_referer', '_wpnonce'), wp_unslash($_SERVER['REQUEST_URI']) );
    162 
    163     if ( ! empty( $_REQUEST['paged'] ) )
    164         $location = add_query_arg( 'paged', (int) $_REQUEST['paged'] );
    165 
     162}
     163
     164if ( $location ) {
     165    if ( ! empty( $_REQUEST['paged'] ) ) {
     166        $location = add_query_arg( 'paged', (int) $_REQUEST['paged'], $location );
     167    }
    166168    wp_redirect( $location );
    167169    exit;
     
    584586try{document.forms.addtag['tag-name'].focus();}catch(e){}
    585587</script>
    586 <?php $wp_list_table->inline_edit(); ?>
    587 
    588588<?php
    589 break;
    590 }
     589$wp_list_table->inline_edit();
    591590
    592591include( ABSPATH . 'wp-admin/admin-footer.php' );
Note: See TracChangeset for help on using the changeset viewer.