WordPress.org

Make WordPress Core

Ticket #15518: exit-after-redirects.15518.2.diff

File exit-after-redirects.15518.2.diff, 11.7 KB (added by filosofo, 7 years ago)
  • wp-pass.php

     
    1616setcookie('wp-postpass_' . COOKIEHASH, $_POST['post_password'], time() + 864000, COOKIEPATH);
    1717
    1818wp_safe_redirect(wp_get_referer());
    19 ?>
    20  No newline at end of file
     19exit;
     20?>
  • wp-rss.php

     
    88
    99require( './wp-load.php' );
    1010wp_redirect( get_bloginfo( 'rss_url' ), 301 );
    11 
    12 ?>
    13  No newline at end of file
     11exit;
     12?>
  • wp-comments-post.php

     
    101101$location = apply_filters('comment_post_redirect', $location, $comment);
    102102
    103103wp_redirect($location);
    104 
     104exit;
    105105?>
  • wp-rdf.php

     
    88
    99require( './wp-load.php' );
    1010wp_redirect( get_bloginfo( 'rdf_url' ), 301 );
    11 
    12 ?>
    13  No newline at end of file
     11exit;
     12?>
  • wp-register.php

     
    1111
    1212require('./wp-load.php');
    1313wp_redirect( site_url('wp-login.php?action=register') );
    14 
    15 ?>
    16  No newline at end of file
     14exit;
     15?>
  • wp-rss2.php

     
    88
    99require( './wp-load.php' );
    1010wp_redirect( get_bloginfo( 'rss2_url' ), 301 );
    11 
    12 ?>
    13  No newline at end of file
     11exit;
     12?>
  • wp-commentsrss2.php

     
    88
    99require( './wp-load.php' );
    1010wp_redirect( get_bloginfo( 'comments_rss2_url' ), 301 );
    11 
    12 ?>
    13  No newline at end of file
     11exit;
     12?>
  • wp-atom.php

     
    88
    99require( './wp-load.php' );
    1010wp_redirect( get_bloginfo( 'atom_url' ), 301 );
    11 
    12 ?>
    13  No newline at end of file
     11exit;
     12?>
  • wp-admin/ms-edit.php

     
    99
    1010require_once( './admin.php' );
    1111
    12 wp_redirect( network_admin_url() );
    13  No newline at end of file
     12wp_redirect( network_admin_url() );
     13exit;
     14?>
  • wp-admin/includes/ms.php

     
    507507
    508508        if ( is_object( $blog ) ) {
    509509                wp_redirect( get_admin_url( $blog->blog_id, '?c=' . $c ) ); // redirect and count to 5, "just in case"
    510                 exit;
    511510        } else {
    512511                wp_redirect( user_admin_url( '?c=' . $c ) ); // redirect and count to 5, "just in case"
    513512        }
    514 
    515         wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
     513        exit;
    516514}
    517515add_action( 'admin_page_access_denied', 'redirect_user_to_blog', 99 );
    518516
  • wp-admin/post.php

     
    8585        }
    8686
    8787        wp_redirect( apply_filters( 'redirect_post_location', $location, $post_id ) );
     88        exit;
    8889}
    8990
    9091if ( isset( $_POST['deletepost'] ) )
     
    265266        break;
    266267
    267268default:
    268                 wp_redirect( admin_url('edit.php') );
     269        wp_redirect( admin_url('edit.php') );
    269270        exit();
    270271        break;
    271272} // end switch
  • wp-admin/admin.php

     
    178178        if ( ! current_user_can('import') )
    179179                wp_die(__('You are not allowed to import.'));
    180180
    181         if ( validate_file($importer) )
     181        if ( validate_file($importer) ) {
    182182                wp_redirect( admin_url( 'import.php?invalid=' . $importer ) );
     183                exit;
     184        }
    183185
    184186        // Allow plugins to define importers as well
    185187        if ( !isset($wp_importers) || !isset($wp_importers[$importer]) || ! is_callable($wp_importers[$importer][2])) {
    186                 if (! file_exists(ABSPATH . "wp-admin/import/$importer.php"))
     188                if (! file_exists(ABSPATH . "wp-admin/import/$importer.php")) {
    187189                        wp_redirect( admin_url( 'import.php?invalid=' . $importer ) );
     190                        exit;
     191                }
    188192                include(ABSPATH . "wp-admin/import/$importer.php");
    189193        }
    190194
  • wp-admin/media-upload.php

     
    5555                        $location .= '?message=3';
    5656
    5757                wp_redirect( admin_url($location) );
     58                exit;
    5859        }
    5960
    6061        $title = __('Upload New Media');
  • wp-admin/moderation.php

     
    99 */
    1010require_once('../wp-load.php');
    1111wp_redirect( admin_url('edit-comments.php?comment_status=moderated') );
     12exit;
    1213?>
  • wp-admin/ms-sites.php

     
    99
    1010require_once( './admin.php' );
    1111
    12 wp_redirect( network_admin_url('sites.php') );
    13  No newline at end of file
     12wp_redirect( network_admin_url('sites.php') );
     13exit;
     14
     15?>
  • wp-admin/ms-upgrade-network.php

     
    99
    1010require_once('admin.php');
    1111
    12 wp_redirect( network_admin_url('upgrade.php') );
    13  No newline at end of file
     12wp_redirect( network_admin_url('upgrade.php') );
     13exit;
     14
     15?>
  • wp-admin/network/site-info.php

     
    5858
    5959        restore_current_blog();
    6060        wp_redirect( add_query_arg( array( 'update' => 'updated', 'id' => $id ), 'site-info.php') );
     61        exit;
    6162}
    6263
    6364if ( isset($_GET['update']) ) {
  • wp-admin/network/site-options.php

     
    4848        do_action( 'wpmu_update_blog_options' );
    4949        restore_current_blog();
    5050        wp_redirect( add_query_arg( array( 'update' => 'updated', 'id' => $id ), 'site-options.php') );
     51        exit;
    5152}
    5253
    5354if ( isset($_GET['update']) ) {
     
    131132
    132133</div>
    133134<?php
    134 require('../admin-footer.php');
    135  No newline at end of file
     135require('../admin-footer.php');
  • wp-admin/network/site-users.php

     
    279279</form>
    280280</div>
    281281<?php
    282 require('../admin-footer.php');
    283  No newline at end of file
     282require('../admin-footer.php');
  • wp-admin/network/edit.php

     
    1313if ( ! is_multisite() )
    1414        wp_die( __( 'Multisite support is not enabled.' ) );
    1515
    16 if ( empty( $_GET['action'] ) )
     16if ( empty( $_GET['action'] ) ) {
    1717        wp_redirect( admin_url( 'index.php' ) );
     18        exit;
     19}
    1820
    1921function confirm_delete_users( $users ) {
    2022        $current_user = wp_get_current_user();
  • wp-admin/network/admin.php

     
    1515if ( ! is_multisite() )
    1616        wp_die( __( 'Multisite support is not enabled.' ) );
    1717
    18 if ( ! is_main_site() )
     18if ( ! is_main_site() ) {
    1919        wp_redirect( network_admin_url() );
    20 
     20        exit;
     21}
    2122?>
  • wp-admin/ms-users.php

     
    99
    1010require_once( './admin.php' );
    1111
    12 wp_redirect( network_admin_url('users.php') );
    13  No newline at end of file
     12wp_redirect( network_admin_url('users.php') );
     13exit;
     14?>
  • wp-admin/ms-themes.php

     
    99
    1010require_once( './admin.php' );
    1111
    12 wp_redirect( network_admin_url('themes.php') );
    13  No newline at end of file
     12wp_redirect( network_admin_url('themes.php') );
     13exit;
     14?>
  • wp-admin/link-manager.php

     
    2929                }
    3030
    3131                wp_redirect( add_query_arg('deleted', count( $bulklinks ), admin_url( 'link-manager.php' ) ) );
     32                exit;
    3233        }
    3334} elseif ( ! empty( $_REQUEST['_wp_http_referer'] ) ) {
    3435         wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) );
  • wp-admin/ms-admin.php

     
    99
    1010require_once( './admin.php' );
    1111
    12 wp_redirect( network_admin_url() );
    13  No newline at end of file
     12wp_redirect( network_admin_url() );
     13exit;
     14?>
  • wp-admin/update-core.php

     
    366366                return;
    367367        dismiss_core_update( $update );
    368368        wp_redirect( wp_nonce_url('update-core.php?action=upgrade-core', 'upgrade-core') );
     369        exit;
    369370}
    370371
    371372function do_undismiss_core_update() {
     
    376377                return;
    377378        undismiss_core_update( $version, $locale );
    378379        wp_redirect( wp_nonce_url('update-core.php?action=upgrade-core', 'upgrade-core') );
     380        exit;
    379381}
    380382
    381383function no_update_actions($actions) {
  • wp-admin/plugin-editor.php

     
    7070                        update_option('recently_activated', array($file => time()) + (array)get_option('recently_activated'));
    7171
    7272                        wp_redirect(add_query_arg('_wpnonce', wp_create_nonce('edit-plugin-test_' . $file), "plugin-editor.php?file=$file&liveupdate=1&scrollto=$scrollto&networkwide=" . $network_wide));
    73                         exit;
    7473                }
    7574                wp_redirect( self_admin_url("plugin-editor.php?file=$file&a=te&scrollto=$scrollto") );
    7675        } else {
  • wp-admin/user/admin.php

     
    1111
    1212require_once( dirname(dirname(__FILE__)) . '/admin.php');
    1313
    14 if ( ! is_main_site() )
     14if ( ! is_main_site() ) {
    1515        wp_redirect( user_admin_url() );
    16 
     16        exit;
     17}
    1718?>
  • wp-feed.php

     
    88
    99require( './wp-load.php' );
    1010wp_redirect( get_bloginfo( get_default_feed() . '_url' ), 301 );
    11 
    12 ?>
    13  No newline at end of file
     11exit;
     12?>