Ticket #25207: 25207.diff
File 25207.diff, 63.1 KB (added by , 12 years ago) |
---|
-
wp-activate.php
13 13 14 14 require( './wp-blog-header.php' ); 15 15 16 if ( ! is_multisite() ) {17 wp_redirect( site_url( '/wp-login.php?action=register' ) );18 die();16 if ( ! is_multisite() ) { 17 if ( wp_redirect( site_url( '/wp-login.php?action=register' ) ) ) 18 die(); 19 19 } 20 20 21 21 if ( is_object( $wp_object_cache ) ) -
wp-admin/admin.php
42 42 */ 43 43 do_action('after_db_upgrade'); 44 44 } elseif ( get_option('db_version') != $wp_db_version && empty($_POST) ) { 45 if ( !is_multisite() ) { 46 wp_redirect( admin_url( 'upgrade.php?_wp_http_referer=' . urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) ); 47 exit; 45 if ( ! is_multisite() ) { 46 $request_uri = urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ); 47 if ( wp_redirect( admin_url( 'upgrade.php?_wp_http_referer=' . $request_uri ) ) ); 48 exit; 48 49 } elseif ( apply_filters( 'do_mu_upgrade', true ) ) { 49 50 /** 50 51 * On really small MU installs run the upgrader every time, … … 122 123 $query_string = $_SERVER[ 'QUERY_STRING' ]; 123 124 else 124 125 $query_string = 'page=' . $plugin_page; 125 wp_redirect( admin_url('tools.php?' . $query_string) ); 126 exit; 126 127 if ( wp_redirect( admin_url('tools.php?' . $query_string) ) ); 128 exit; 127 129 } 128 130 } 129 131 unset($the_parent); … … 175 177 if ( ! current_user_can('import') ) 176 178 wp_die(__('You are not allowed to import.')); 177 179 178 if ( validate_file( $importer) ) {179 wp_redirect( admin_url( 'import.php?invalid=' . $importer ) );180 exit;180 if ( validate_file( $importer ) ) { 181 if ( wp_redirect( admin_url( 'import.php?invalid=' . $importer ) ) ) 182 exit; 181 183 } 182 184 183 185 if ( ! isset($wp_importers[$importer]) || ! is_callable($wp_importers[$importer][2]) ) { 184 wp_redirect( admin_url( 'import.php?invalid=' . $importer ) );185 exit;186 if ( wp_redirect( admin_url( 'import.php?invalid=' . $importer ) ) ) 187 exit; 186 188 } 187 189 188 190 do_action( 'load-importer-' . $importer ); -
wp-admin/comment.php
88 88 89 89 $comment_id = absint( $_GET['c'] ); 90 90 91 if ( ! $comment = get_comment_to_edit( $comment_id ) ) {92 wp_redirect( admin_url('edit-comments.php?error=1') );93 die();91 if ( ! $comment = get_comment_to_edit( $comment_id ) ) { 92 if ( wp_redirect( admin_url('edit-comments.php?error=1') ) ) 93 die(); 94 94 } 95 95 96 if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) {97 wp_redirect( admin_url('edit-comments.php?error=2') );98 die();96 if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) { 97 if ( wp_redirect( admin_url('edit-comments.php?error=2') ) ) 98 die(); 99 99 } 100 100 101 101 // No need to re-approve/re-trash/re-spam a comment. 102 102 if ( $action == str_replace( '1', 'approve', $comment->comment_approved ) ) { 103 wp_redirect( admin_url( 'edit-comments.php?same=' . $comment_id ) );104 die();103 if ( wp_redirect( admin_url( 'edit-comments.php?same=' . $comment_id ) ) ) 104 die(); 105 105 } 106 106 107 107 require_once('./admin-header.php'); … … 265 265 break; 266 266 } 267 267 268 wp_redirect( $redir ); 269 die; 268 if ( wp_redirect( $redir ) ) 269 die; 270 270 271 break; 271 272 272 273 case 'editedcomment' : … … 280 281 281 282 $location = ( empty( $_POST['referredby'] ) ? "edit-comments.php?p=$comment_post_id" : $_POST['referredby'] ) . '#comment-' . $comment_id; 282 283 $location = apply_filters( 'comment_edit_redirect', $location, $comment_id ); 283 wp_redirect( $location ); 284 if ( wp_redirect( $location ) ) 285 exit(); 284 286 285 exit();286 287 break; 287 288 288 289 default: -
wp-admin/edit-comments.php
95 95 wp_safe_redirect( $redirect_to ); 96 96 exit; 97 97 } elseif ( ! empty( $_GET['_wp_http_referer'] ) ) { 98 wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );99 exit;98 if ( wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) ) 99 exit; 100 100 } 101 101 102 102 $wp_list_table->prepare_items(); -
wp-admin/edit-tags.php
61 61 $location = add_query_arg( 'message', 1, $location ); 62 62 else 63 63 $location = add_query_arg( 'message', 4, $location ); 64 wp_redirect( $location ); 65 exit; 64 65 if ( wp_redirect( $location ) ) 66 exit; 67 66 68 break; 67 69 68 70 case 'delete': … … 74 76 $location = $referer; 75 77 } 76 78 77 if ( !isset( $_REQUEST['tag_ID'] ) ) { 78 wp_redirect( $location ); 79 if ( ! isset( $_REQUEST['tag_ID'] ) && wp_redirect( $location ) ) 79 80 exit; 80 }81 81 82 82 $tag_ID = (int) $_REQUEST['tag_ID']; 83 83 check_admin_referer( 'delete-tag_' . $tag_ID ); … … 88 88 wp_delete_term( $tag_ID, $taxonomy ); 89 89 90 90 $location = add_query_arg( 'message', 2, $location ); 91 wp_redirect( $location );92 exit;93 91 92 if ( wp_redirect( $location ) ) 93 exit; 94 94 95 break; 95 96 96 97 case 'bulk-delete': … … 113 114 } 114 115 115 116 $location = add_query_arg( 'message', 6, $location ); 116 wp_redirect( $location );117 exit;118 117 118 if ( wp_redirect( $location ) ) 119 exit; 120 119 121 break; 120 122 121 123 case 'edit': … … 158 160 else 159 161 $location = add_query_arg( 'message', 5, $location ); 160 162 161 wp_redirect( $location ); 162 exit; 163 if ( wp_redirect( $location ) ) 164 exit; 165 163 166 break; 164 167 165 168 default: … … 169 172 if ( ! empty( $_REQUEST['paged'] ) ) 170 173 $location = add_query_arg( 'paged', (int) $_REQUEST['paged'] ); 171 174 172 wp_redirect( $location );173 exit;175 if ( wp_redirect( $location ) ) 176 exit; 174 177 } 175 178 176 179 $wp_list_table->prepare_items(); 177 180 $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); 178 181 179 182 if ( $pagenum > $total_pages && $total_pages > 0 ) { 180 wp_redirect( add_query_arg( 'paged', $total_pages ) );181 exit;183 if ( wp_redirect( add_query_arg( 'paged', $total_pages ) ) ) 184 exit; 182 185 } 183 186 184 187 wp_enqueue_script('admin-tags'); -
wp-admin/edit.php
27 27 // Back-compat for viewing comments of an entry 28 28 foreach ( array( 'p', 'attachment_id', 'page_id' ) as $_redirect ) { 29 29 if ( ! empty( $_REQUEST[ $_redirect ] ) ) { 30 wp_redirect( admin_url( 'edit-comments.php?p=' . absint( $_REQUEST[ $_redirect ] ) ) );31 exit;30 if ( wp_redirect( admin_url( 'edit-comments.php?p=' . absint( $_REQUEST[ $_redirect ] ) ) ) ) 31 exit; 32 32 } 33 33 } 34 34 unset( $_redirect ); … … 68 68 $post_ids = array_map('intval', $_REQUEST['post']); 69 69 } 70 70 71 if ( ! isset( $post_ids ) ) {72 wp_redirect( $sendback );73 exit;71 if ( ! isset( $post_ids ) ) { 72 if ( wp_redirect( $sendback ) ) 73 exit; 74 74 } 75 75 76 76 switch ( $doaction ) { … … 142 142 143 143 $sendback = remove_query_arg( array('action', 'action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view'), $sendback ); 144 144 145 wp_redirect($sendback);146 exit();145 if ( wp_redirect( $sendback ) ) 146 exit(); 147 147 } elseif ( ! empty($_REQUEST['_wp_http_referer']) ) { 148 wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), wp_unslash($_SERVER['REQUEST_URI']) ) );149 exit;148 if ( wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), wp_unslash($_SERVER['REQUEST_URI']) ) ) ) 149 exit; 150 150 } 151 151 152 152 $wp_list_table->prepare_items(); -
wp-admin/import.php
38 38 if ( ! empty( $_GET['invalid'] ) && isset( $popular_importers[ $_GET['invalid'] ] ) ) { 39 39 $importer_id = $popular_importers[ $_GET['invalid'] ]['importer-id']; 40 40 if ( $importer_id != $_GET['invalid'] ) { // Prevent redirect loops. 41 wp_redirect( admin_url( 'admin.php?import=' . $importer_id ) );42 exit;41 if ( wp_redirect( admin_url( 'admin.php?import=' . $importer_id ) ) ) 42 exit; 43 43 } 44 44 unset( $importer_id ); 45 45 } -
wp-admin/includes/class-wp-list-table.php
145 145 146 146 // redirect if page number is invalid and headers are not already sent 147 147 if ( ! headers_sent() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) && $args['total_pages'] > 0 && $this->get_pagenum() > $args['total_pages'] ) { 148 wp_redirect( add_query_arg( 'paged', $args['total_pages'] ) );149 exit;148 if ( wp_redirect( add_query_arg( 'paged', $args['total_pages'] ) ) ) 149 exit; 150 150 } 151 151 152 152 $this->_pagination_args = $args; -
wp-admin/includes/dashboard.php
135 135 ob_start(); // hack - but the same hack wp-admin/widgets.php uses 136 136 wp_dashboard_trigger_widget_control( $_POST['widget_id'] ); 137 137 ob_end_clean(); 138 wp_redirect( remove_query_arg( 'edit' ) );139 exit;138 if ( wp_redirect( remove_query_arg( 'edit' ) ) ) 139 exit; 140 140 } 141 141 142 142 if ( $update ) -
wp-admin/includes/plugin.php
534 534 return $valid; 535 535 536 536 if ( !in_array($plugin, $current) ) { 537 if ( !empty($redirect) ) 538 wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect)); // we'll override this later if the plugin can be included without fatal error 537 if ( ! empty( $redirect ) ) { 538 // we'll override this later if the plugin can be included without fatal error 539 if ( wp_redirect( add_query_arg( '_error_nonce', wp_create_nonce( 'plugin-activation-error_' . $plugin ), $redirect ) ) ) 540 exit; 541 } 542 539 543 ob_start(); 540 544 include_once(WP_PLUGIN_DIR . '/' . $plugin); 541 545 -
wp-admin/link-manager.php
27 27 wp_delete_link( $link_id ); 28 28 } 29 29 30 wp_redirect( add_query_arg('deleted', count( $bulklinks ), admin_url( 'link-manager.php' ) ) );31 exit;30 if ( wp_redirect( add_query_arg('deleted', count( $bulklinks ), admin_url( 'link-manager.php' ) ) ) ) 31 exit; 32 32 } 33 33 } elseif ( ! empty( $_GET['_wp_http_referer'] ) ) { 34 wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );35 exit;34 if ( wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) ) 35 exit; 36 36 } 37 37 38 38 $wp_list_table->prepare_items(); -
wp-admin/link.php
31 31 check_admin_referer('bulk-bookmarks'); 32 32 33 33 //for each link id (in $linkcheck[]) change category to selected value 34 if (count($linkcheck) == 0) { 35 wp_redirect($this_file); 34 if ( count( $linkcheck ) == 0 && wp_redirect( $this_file ) ) 36 35 exit; 37 }38 36 39 37 $deleted = 0; 40 38 foreach ($linkcheck as $link_id) { … … 44 42 $deleted++; 45 43 } 46 44 47 wp_redirect("$this_file?deleted=$deleted");48 exit;45 if ( wp_redirect( "$this_file?deleted=$deleted" ) ) 46 exit; 49 47 break; 50 48 51 49 case 'move' : 52 50 check_admin_referer('bulk-bookmarks'); 53 51 54 52 //for each link id (in $linkcheck[]) change category to selected value 55 if (count($linkcheck) == 0) { 56 wp_redirect($this_file); 53 if (count($linkcheck) == 0 && wp_redirect( $this_file ) ) 57 54 exit; 58 } 55 59 56 $all_links = join(',', $linkcheck); 60 57 // should now have an array of links we can change 61 58 //$q = $wpdb->query("update $wpdb->links SET link_category='$category' WHERE link_id IN ($all_links)"); 62 59 63 wp_redirect($this_file); 64 exit; 60 if ( wp_redirect( $this_file ) ) 61 exit; 62 65 63 break; 66 64 67 65 case 'add' : … … 71 69 if ( add_link() ) 72 70 $redir = add_query_arg( 'added', 'true', $redir ); 73 71 74 wp_redirect( $redir ); 75 exit; 72 if ( wp_redirect( $redir ) ) 73 exit; 74 76 75 break; 77 76 78 77 case 'save' : … … 81 80 82 81 edit_link($link_id); 83 82 84 wp_redirect($this_file); 85 exit; 83 if ( wp_redirect( $this_file ) ) 84 exit; 85 86 86 break; 87 87 88 88 case 'delete' : … … 91 91 92 92 wp_delete_link($link_id); 93 93 94 wp_redirect($this_file); 95 exit; 94 if ( wp_redirect( $this_file ) ) 95 exit; 96 96 97 break; 97 98 98 99 case 'edit' : -
wp-admin/media-new.php
33 33 if ( is_wp_error( $id ) ) 34 34 $location .= '?message=3'; 35 35 } 36 wp_redirect( admin_url( $location ) ); 37 exit; 36 37 if ( wp_redirect( admin_url( $location ) ) ) 38 exit; 38 39 } 39 40 40 41 $title = __('Upload New Media'); -
wp-admin/media.php
36 36 } elseif ( false !== strpos($location, 'media.php') ) { 37 37 $location = add_query_arg('message', 'updated', $location); 38 38 } 39 wp_redirect($location);40 exit;39 if ( wp_redirect( $location ) ) 40 exit; 41 41 } 42 42 43 43 // no break … … 48 48 $errors = null; 49 49 50 50 if ( empty( $_GET['attachment_id'] ) ) { 51 wp_redirect( admin_url('upload.php') );52 exit();51 if ( wp_redirect( admin_url('upload.php') ) ) 52 exit(); 53 53 } 54 54 $att_id = (int) $_GET['attachment_id']; 55 55 … … 141 141 exit; 142 142 143 143 default: 144 wp_redirect( admin_url('upload.php') );145 exit;144 if ( wp_redirect( admin_url('upload.php') ) ) 145 exit; 146 146 147 147 endswitch; -
wp-admin/moderation.php
8 8 * @subpackage Administration 9 9 */ 10 10 require_once('../wp-load.php'); 11 wp_redirect( admin_url('edit-comments.php?comment_status=moderated') ); 12 exit;11 if ( wp_redirect( admin_url('edit-comments.php?comment_status=moderated') ) ) 12 exit; -
wp-admin/ms-admin.php
9 9 10 10 require_once( './admin.php' ); 11 11 12 wp_redirect( network_admin_url() ); 13 exit;12 if ( wp_redirect( network_admin_url() ) ) 13 exit; -
wp-admin/ms-edit.php
9 9 10 10 require_once( './admin.php' ); 11 11 12 wp_redirect( network_admin_url() ); 13 exit;12 if ( wp_redirect( network_admin_url() ) ) 13 exit; -
wp-admin/ms-options.php
9 9 10 10 require_once( './admin.php' ); 11 11 12 wp_redirect( network_admin_url('settings.php') ); 13 No newline at end of file 12 if ( wp_redirect( network_admin_url('settings.php') ) ) 13 exit; 14 No newline at end of file -
wp-admin/ms-sites.php
9 9 10 10 require_once( './admin.php' ); 11 11 12 wp_redirect( network_admin_url('sites.php') ); 13 exit;12 if ( wp_redirect( network_admin_url('sites.php') ) ) 13 exit; -
wp-admin/ms-themes.php
9 9 10 10 require_once( './admin.php' ); 11 11 12 wp_redirect( network_admin_url('themes.php') ); 13 exit;12 if ( wp_redirect( network_admin_url('themes.php') ) ) 13 exit; -
wp-admin/ms-upgrade-network.php
9 9 10 10 require_once('admin.php'); 11 11 12 wp_redirect( network_admin_url('upgrade.php') ); 13 exit;12 if ( wp_redirect( network_admin_url('upgrade.php') ) ) 13 exit; -
wp-admin/ms-users.php
9 9 10 10 require_once( './admin.php' ); 11 11 12 wp_redirect( network_admin_url('users.php') ); 13 exit;12 if ( wp_redirect( network_admin_url('users.php') ) ) 13 exit; -
wp-admin/nav-menus.php
315 315 set_theme_mod( 'nav_menu_locations', $menu_locations ); 316 316 } 317 317 // $messages[] = '<div id="message" class="updated"><p>' . sprintf( __( '<strong>%s</strong> has been created.' ), $nav_menu_selected_title ) . '</p></div>'; 318 wp_redirect( admin_url( 'nav-menus.php?menu=' . $_nav_menu_selected_id ) ); 319 exit(); 318 319 if ( wp_redirect( admin_url( 'nav-menus.php?menu=' . $_nav_menu_selected_id ) ) ) 320 exit(); 320 321 } 321 322 } else { 322 323 $messages[] = '<div id="message" class="error"><p>' . __( 'Please enter a valid menu name.' ) . '</p></div>'; … … 351 352 } 352 353 break; 353 354 case 'locations': 354 if ( ! $num_locations ) { 355 wp_redirect( admin_url( 'nav-menus.php' ) ); 355 if ( ! $num_locations && wp_redirect( admin_url( 'nav-menus.php' ) ) ) 356 356 exit(); 357 }358 357 359 358 add_filter( 'screen_options_show_screen', '__return_false' ); 360 359 … … 406 405 407 406 // Redirect to add screen if there are no menus and this users has either zero, or more than 1 theme locations 408 407 if ( 0 == $menu_count && ! $add_new_screen && ! $one_theme_location_no_menus ) 409 wp_redirect( admin_url( 'nav-menus.php?action=edit&menu=0' ) ); 408 if ( wp_redirect( admin_url( 'nav-menus.php?action=edit&menu=0' ) ) ) 409 exit; 410 410 411 411 // Get recently edited nav menu 412 412 $recently_edited = absint( get_user_option( 'nav_menu_recently_edited' ) ); -
wp-admin/network/admin.php
17 17 18 18 $redirect_network_admin_request = ( ( $current_blog->domain != $current_site->domain ) || ( $current_blog->path != $current_site->path ) ); 19 19 $redirect_network_admin_request = apply_filters( 'redirect_network_admin_request', $redirect_network_admin_request ); 20 if ( $redirect_network_admin_request ) { 21 wp_redirect( network_admin_url() ); 20 21 if ( $redirect_network_admin_request && wp_redirect( network_admin_url() ) ) 22 22 exit; 23 } 23 24 24 unset( $redirect_network_admin_request ); -
wp-admin/network/edit.php
13 13 if ( ! is_multisite() ) 14 14 wp_die( __( 'Multisite support is not enabled.' ) ); 15 15 16 if ( empty( $_GET['action'] ) ) { 17 wp_redirect( network_admin_url() ); 16 if ( empty( $_GET['action'] ) && wp_redirect( network_admin_url() ) ) 18 17 exit; 19 }20 18 21 19 do_action( 'wpmuadminedit' , '' ); 22 20 23 21 // Let plugins use us as a post handler easily 24 22 do_action( 'network_admin_edit_' . $_GET['action'] ); 25 23 26 wp_redirect( network_admin_url() ); 27 exit();24 if ( wp_redirect( network_admin_url() ) ) 25 exit(); -
wp-admin/network/settings.php
67 67 // Update more options here 68 68 do_action( 'update_wpmu_options' ); 69 69 70 wp_redirect( add_query_arg( 'updated', 'true', network_admin_url( 'settings.php' ) ) );71 exit();70 if ( wp_redirect( add_query_arg( 'updated', 'true', network_admin_url( 'settings.php' ) ) ) ) 71 exit(); 72 72 } 73 73 74 74 include( '../admin-header.php' ); -
wp-admin/network/site-info.php
74 74 update_blog_details( $id, $blog_data ); 75 75 76 76 restore_current_blog(); 77 wp_redirect( add_query_arg( array( 'update' => 'updated', 'id' => $id ), 'site-info.php') );78 exit;77 if ( wp_redirect( add_query_arg( array( 'update' => 'updated', 'id' => $id ), 'site-info.php') ) ) 78 exit; 79 79 } 80 80 81 81 if ( isset($_GET['update']) ) { -
wp-admin/network/site-new.php
91 91 Name: %3$s' ), $current_user->user_login , get_site_url( $id ), wp_unslash( $title ) ); 92 92 wp_mail( get_site_option('admin_email'), sprintf( __( '[%s] New Site Created' ), $current_site->site_name ), $content_mail, 'From: "Site Admin" <' . get_site_option( 'admin_email' ) . '>' ); 93 93 wpmu_welcome_notification( $id, $user_id, $password, $title, array( 'public' => 1 ) ); 94 wp_redirect( add_query_arg( array( 'update' => 'added', 'id' => $id ), 'site-new.php' ) );95 exit;94 if ( wp_redirect( add_query_arg( array( 'update' => 'added', 'id' => $id ), 'site-new.php' ) ) ) 95 exit; 96 96 } else { 97 97 wp_die( $id->get_error_message() ); 98 98 } -
wp-admin/network/site-settings.php
60 60 61 61 do_action( 'wpmu_update_blog_options' ); 62 62 restore_current_blog(); 63 wp_redirect( add_query_arg( array( 'update' => 'updated', 'id' => $id ), 'site-settings.php') );64 exit;63 if ( wp_redirect( add_query_arg( array( 'update' => 'updated', 'id' => $id ), 'site-settings.php') ) ) 64 exit; 65 65 } 66 66 67 67 if ( isset($_GET['update']) ) { -
wp-admin/network/sites.php
138 138 } 139 139 } 140 140 } else { 141 wp_redirect( network_admin_url( 'sites.php' ) );142 exit();141 if ( wp_redirect( network_admin_url( 'sites.php' ) ) ) 142 exit(); 143 143 } 144 144 break; 145 145 -
wp-admin/network/themes.php
35 35 check_admin_referer('enable-theme_' . $_GET['theme']); 36 36 $allowed_themes[ $_GET['theme'] ] = true; 37 37 update_site_option( 'allowedthemes', $allowed_themes ); 38 if ( false === strpos( $referer, '/network/themes.php' ) ) 39 wp_redirect( network_admin_url( 'themes.php?enabled=1' ) ); 40 else 41 wp_safe_redirect( add_query_arg( 'enabled', 1, $referer ) ); 42 exit; 38 if ( false === strpos( $referer, '/network/themes.php' ) ) { 39 if ( wp_redirect( network_admin_url( 'themes.php?enabled=1' ) ) ) 40 exit; 41 } else { 42 if ( wp_safe_redirect( add_query_arg( 'enabled', 1, $referer ) ) ) 43 exit; 44 } 43 45 break; 44 46 case 'disable': 45 47 check_admin_referer('disable-theme_' . $_GET['theme']); … … 186 188 } 187 189 188 190 $paged = ( $_REQUEST['paged'] ) ? $_REQUEST['paged'] : 1; 189 wp_redirect( add_query_arg( array(191 if ( wp_redirect( add_query_arg( array( 190 192 'deleted' => count( $themes ), 191 193 'paged' => $paged, 192 194 's' => $s 193 ), network_admin_url( 'themes.php' ) ) ); 194 exit; 195 ), network_admin_url( 'themes.php' ) ) ) ) 196 exit; 197 195 198 break; 196 199 } 197 200 } -
wp-admin/network/user-new.php
51 51 $add_user_errors = new WP_Error( 'add_user_fail', __( 'Cannot add user.' ) ); 52 52 } else { 53 53 wp_new_user_notification( $user_id, $password ); 54 wp_redirect( add_query_arg( array('update' => 'added'), 'user-new.php' ) );55 exit;54 if ( wp_redirect( add_query_arg( array('update' => 'added'), 'user-new.php' ) ) ) 55 exit; 56 56 } 57 57 } 58 58 } -
wp-admin/network/users.php
107 107 echo '</div>'; 108 108 require_once( '../admin-footer.php' ); 109 109 } else { 110 wp_redirect( network_admin_url( 'users.php' ) ); 110 if ( wp_redirect( network_admin_url( 'users.php' ) ) ) 111 exit; 111 112 } 112 113 exit(); 113 114 break; … … 170 171 171 172 if ( ! empty( $_REQUEST['paged'] ) ) 172 173 $location = add_query_arg( 'paged', (int) $_REQUEST['paged'], $location ); 173 wp_redirect( $location ); 174 if ( wp_redirect( $location ) ) 175 exit; 174 176 } 175 177 exit(); 176 178 break; … … 207 209 else 208 210 $deletefunction = 'all_delete'; 209 211 210 wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => $deletefunction ), network_admin_url( 'users.php' ) ) );211 exit();212 if ( wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => $deletefunction ), network_admin_url( 'users.php' ) ) ) ) 213 exit(); 212 214 break; 213 215 } 214 216 } … … 219 221 $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); 220 222 221 223 if ( $pagenum > $total_pages && $total_pages > 0 ) { 222 wp_redirect( add_query_arg( 'paged', $total_pages ) );223 exit;224 if ( wp_redirect( add_query_arg( 'paged', $total_pages ) ) ) 225 exit; 224 226 } 225 227 $title = __( 'Users' ); 226 228 $parent_file = 'users.php'; -
wp-admin/network.php
19 19 wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) ); 20 20 21 21 if ( is_multisite() ) { 22 if ( ! is_network_admin() ) { 23 wp_redirect( network_admin_url( 'setup.php' ) ); 22 if ( ! is_network_admin() && wp_redirect( network_admin_url( 'setup.php' ) ) ) 24 23 exit; 25 } 24 26 25 if ( ! defined( 'MULTISITE' ) ) 27 26 wp_die( __( 'The Network creation panel is not for WordPress MU networks.' ) ); 28 27 } -
wp-admin/options-permalink.php
113 113 $wp_rewrite->set_tag_base( $tag_base ); 114 114 } 115 115 116 wp_redirect( admin_url( 'options-permalink.php?settings-updated=true' ) );117 exit;116 if ( wp_redirect( admin_url( 'options-permalink.php?settings-updated=true' ) ) ) 117 exit; 118 118 } 119 119 120 120 $permalink_structure = get_option('permalink_structure'); -
wp-admin/options.php
45 45 delete_option( 'new_admin_email' ); 46 46 $redirect = 'options-general.php?updated=true'; 47 47 } 48 wp_redirect( admin_url( $redirect ) ); 49 exit; 48 49 if ( wp_redirect( admin_url( $redirect ) ) ) 50 exit; 50 51 } elseif ( ! empty( $_GET['dismiss'] ) && 'new_admin_email' == $_GET['dismiss'] ) { 51 52 delete_option( 'adminhash' ); 52 53 delete_option( 'new_admin_email' ); 53 wp_redirect( admin_url( 'options-general.php?updated=true' ) ); 54 exit; 54 55 if ( wp_redirect( admin_url( 'options-general.php?updated=true' ) ) ) 56 exit; 55 57 } 56 58 } 57 59 … … 168 170 * Redirect back to the settings page that was submitted 169 171 */ 170 172 $goback = add_query_arg( 'settings-updated', 'true', wp_get_referer() ); 171 wp_redirect( $goback ); 172 exit; 173 174 if ( wp_redirect( $goback ) ) 175 exit; 173 176 } 174 177 175 178 include('./admin-header.php'); ?> -
wp-admin/plugin-editor.php
10 10 require_once('./admin.php'); 11 11 12 12 if ( is_multisite() && ! is_network_admin() ) { 13 wp_redirect( network_admin_url( 'plugin-editor.php' ) );14 exit();13 if ( wp_redirect( network_admin_url( 'plugin-editor.php' ) ) ) 14 exit(); 15 15 } 16 16 17 17 if ( !current_user_can('edit_plugins') ) … … 65 65 if ( ! is_network_admin() ) 66 66 update_option( 'recently_activated', array( $file => time() ) + (array) get_option( 'recently_activated' ) ); 67 67 68 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)); 68 $update_url = wp_create_nonce( 'edit-plugin-test_' . $file), "plugin-editor.php?file=$file&liveupdate=1&scrollto=$scrollto&networkwide=" . $network_wide; 69 if ( wp_redirect( add_query_arg('_wpnonce', $update_url ) ) ) 70 exit; 71 } 72 if ( wp_redirect( self_admin_url("plugin-editor.php?file=$file&a=te&scrollto=$scrollto") ) ) 69 73 exit; 70 }71 wp_redirect( self_admin_url("plugin-editor.php?file=$file&a=te&scrollto=$scrollto") );72 74 } else { 73 wp_redirect( self_admin_url("plugin-editor.php?file=$file&scrollto=$scrollto") ); 75 if ( wp_redirect( self_admin_url("plugin-editor.php?file=$file&scrollto=$scrollto") ) ) 76 exit; 74 77 } 75 78 exit; 76 79 … … 88 91 if ( ( ! empty( $_GET['networkwide'] ) && ! is_plugin_active_for_network($file) ) || ! is_plugin_active($file) ) 89 92 activate_plugin($file, "plugin-editor.php?file=$file&phperror=1", ! empty( $_GET['networkwide'] ) ); // we'll override this later if the plugin can be included without fatal error 90 93 91 wp_redirect( self_admin_url("plugin-editor.php?file=$file&a=te&scrollto=$scrollto") );92 exit;94 if ( wp_redirect( self_admin_url("plugin-editor.php?file=$file&a=te&scrollto=$scrollto") ) ) 95 exit; 93 96 } 94 97 95 98 // List of allowable extensions -
wp-admin/plugin-install.php
16 16 wp_die(__('You do not have sufficient permissions to install plugins on this site.')); 17 17 18 18 if ( is_multisite() && ! is_network_admin() ) { 19 wp_redirect( network_admin_url( 'plugin-install.php' ) );20 exit();19 if ( wp_redirect( network_admin_url( 'plugin-install.php' ) ) ) 20 exit(); 21 21 } 22 22 23 23 $wp_list_table = _get_list_table('WP_Plugin_Install_List_Table'); -
wp-admin/plugins.php
31 31 wp_die(__('You do not have sufficient permissions to activate plugins for this site.')); 32 32 33 33 if ( is_multisite() && ! is_network_admin() && is_network_only_plugin( $plugin ) ) { 34 wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );34 if ( wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") ) ) 35 35 exit; 36 36 } 37 37 … … 41 41 if ( is_wp_error( $result ) ) { 42 42 if ( 'unexpected_output' == $result->get_error_code() ) { 43 43 $redirect = self_admin_url('plugins.php?error=true&charsout=' . strlen($result->get_error_data()) . '&plugin=' . $plugin . "&plugin_status=$status&paged=$page&s=$s"); 44 wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect));45 exit;44 if ( wp_redirect( add_query_arg( '_error_nonce', wp_create_nonce( 'plugin-activation-error_' . $plugin ), $redirect ) ) ) 45 exit; 46 46 } else { 47 47 wp_die($result); 48 48 } … … 55 55 } 56 56 57 57 if ( isset($_GET['from']) && 'import' == $_GET['from'] ) { 58 wp_redirect( self_admin_url("import.php?import=" . str_replace('-importer', '', dirname($plugin))) ); // overrides the ?error=true one above and redirects to the Imports page, stripping the -importer suffix 58 // overrides the ?error=true one above and redirects to the Imports page, stripping the -importer suffix 59 if ( wp_redirect( self_admin_url( "import.php?import=" . str_replace('-importer', '', dirname( $plugin ) ) ) ) ) 60 exit; 59 61 } else { 60 wp_redirect( self_admin_url("plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s") ); // overrides the ?error=true one above 62 // overrides the ?error=true one above 63 if ( wp_redirect( self_admin_url("plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s") ) ) 64 exit; 61 65 } 62 66 exit; 63 67 break; … … 82 86 } 83 87 } 84 88 85 if ( empty( $plugins) ) {86 wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );87 exit;89 if ( empty( $plugins ) ) { 90 if ( wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) ) ) 91 exit; 88 92 } 89 93 90 94 activate_plugins($plugins, self_admin_url('plugins.php?error=true'), is_network_admin() ); … … 96 100 update_option( 'recently_activated', $recent ); 97 101 } 98 102 99 wp_redirect( self_admin_url("plugins.php?activate-multi=true&plugin_status=$status&paged=$page&s=$s") ); 100 exit; 103 if ( wp_redirect( self_admin_url( "plugins.php?activate-multi=true&plugin_status=$status&paged=$page&s=$s" ) ) ) 104 exit; 105 101 106 break; 102 107 case 'update-selected' : 103 108 … … 157 162 check_admin_referer('deactivate-plugin_' . $plugin); 158 163 159 164 if ( ! is_network_admin() && is_plugin_active_for_network( $plugin ) ) { 160 wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );161 exit;165 if ( wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) ) ) 166 exit; 162 167 } 163 168 164 169 deactivate_plugins( $plugin, false, is_network_admin() ); 165 170 if ( ! is_network_admin() ) 166 171 update_option( 'recently_activated', array( $plugin => time() ) + (array) get_option( 'recently_activated' ) ); 167 if ( headers_sent() ) 172 if ( headers_sent() ) { 168 173 echo "<meta http-equiv='refresh' content='" . esc_attr( "0;url=plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s" ) . "' />"; 169 else 170 wp_redirect( self_admin_url("plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s") ); 171 exit; 174 } else { 175 if ( wp_redirect( self_admin_url( "plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s" ) ) ) 176 exit; 177 } 172 178 break; 173 179 case 'deactivate-selected': 174 180 if ( ! current_user_can('activate_plugins') ) … … 184 190 $plugins = array_filter( $plugins, 'is_plugin_active' ); 185 191 $plugins = array_diff( $plugins, array_filter( $plugins, 'is_plugin_active_for_network' ) ); 186 192 } 187 if ( empty( $plugins) ) {188 wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );189 exit;193 if ( empty( $plugins ) ) { 194 if ( wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) ) ) 195 exit; 190 196 } 191 197 192 198 deactivate_plugins( $plugins, false, is_network_admin() ); … … 198 204 update_option( 'recently_activated', $deactivated + (array) get_option( 'recently_activated' ) ); 199 205 } 200 206 201 wp_redirect( self_admin_url("plugins.php?deactivate-multi=true&plugin_status=$status&paged=$page&s=$s") ); 202 exit; 207 if ( wp_redirect( self_admin_url( "plugins.php?deactivate-multi=true&plugin_status=$status&paged=$page&s=$s" ) ) ) 208 exit; 209 203 210 break; 204 211 case 'delete-selected': 205 212 if ( ! current_user_can('delete_plugins') ) … … 210 217 //$_POST = from the plugin form; $_GET = from the FTP details screen. 211 218 $plugins = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array(); 212 219 if ( empty( $plugins ) ) { 213 wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );214 exit;220 if ( wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) ) ) 221 exit; 215 222 } 216 223 217 224 $plugins = array_filter($plugins, 'is_plugin_inactive'); // Do not allow to delete Activated plugins. 218 225 if ( empty( $plugins ) ) { 219 wp_redirect( self_admin_url( "plugins.php?error=true&main=true&plugin_status=$status&paged=$page&s=$s" ) );220 exit;226 if ( wp_redirect( self_admin_url( "plugins.php?error=true&main=true&plugin_status=$status&paged=$page&s=$s" ) ) ) 227 exit; 221 228 } 222 229 223 230 include(ABSPATH . 'wp-admin/update.php'); … … 318 325 $delete_result = delete_plugins($plugins); 319 326 320 327 set_transient('plugins_delete_result_' . $user_ID, $delete_result); //Store the result in a cache rather than a URL param due to object type & length 321 wp_redirect( self_admin_url("plugins.php?deleted=true&plugin_status=$status&paged=$page&s=$s") ); 322 exit; 328 329 if ( wp_redirect( self_admin_url( "plugins.php?deleted=true&plugin_status=$status&paged=$page&s=$s" ) ) ) 330 exit; 331 323 332 break; 324 333 case 'clear-recent-list': 325 334 if ( ! is_network_admin() ) -
wp-admin/post-new.php
22 22 $parent_file = 'edit.php'; 23 23 $submenu_file = 'post-new.php'; 24 24 } elseif ( 'attachment' == $post_type ) { 25 wp_redirect( admin_url( 'media-new.php' ) );26 exit;25 if ( wp_redirect( admin_url( 'media-new.php' ) ) ) 26 exit; 27 27 } else { 28 28 $submenu_file = "post-new.php?post_type=$post_type"; 29 29 if ( isset( $post_type_object ) && $post_type_object->show_in_menu && $post_type_object->show_in_menu !== true ) { -
wp-admin/post.php
72 72 $location = add_query_arg( 'message', 4, get_edit_post_link( $post_id, 'url' ) ); 73 73 } 74 74 75 wp_redirect( apply_filters( 'redirect_post_location', $location, $post_id ) );76 exit;75 if ( wp_redirect( apply_filters( 'redirect_post_location', $location, $post_id ) ) ) 76 exit; 77 77 } 78 78 79 79 if ( isset( $_POST['deletepost'] ) ) … … 128 128 case 'edit': 129 129 $editing = true; 130 130 131 if ( empty( $post_id ) ) { 132 wp_redirect( admin_url('post.php') ); 131 if ( empty( $post_id ) && wp_redirect( admin_url('post.php') ) ) 133 132 exit(); 134 }135 133 136 134 if ( ! $post ) 137 135 wp_die( __( 'You attempted to edit an item that doesn’t exist. Perhaps it was deleted?' ) ); … … 147 145 148 146 if ( ! empty( $_GET['get-post-lock'] ) ) { 149 147 wp_set_post_lock( $post_id ); 150 wp_redirect( get_edit_post_link( $post_id, 'url' ) );151 exit();148 if ( wp_redirect( get_edit_post_link( $post_id, 'url' ) ) ) 149 exit(); 152 150 } 153 151 154 152 $post_type = $post->post_type; … … 246 244 if ( ! wp_trash_post( $post_id ) ) 247 245 wp_die( __( 'Error in moving to Trash.' ) ); 248 246 249 wp_redirect( add_query_arg( array('trashed' => 1, 'ids' => $post_id), $sendback ) ); 250 exit(); 247 if ( wp_redirect( add_query_arg( array('trashed' => 1, 'ids' => $post_id), $sendback ) ) ) 248 exit(); 249 251 250 break; 252 251 253 252 case 'untrash': … … 265 264 if ( ! wp_untrash_post( $post_id ) ) 266 265 wp_die( __( 'Error in restoring from Trash.' ) ); 267 266 268 wp_redirect( add_query_arg('untrashed', 1, $sendback) ); 269 exit(); 267 if ( wp_redirect( add_query_arg('untrashed', 1, $sendback) ) ) 268 exit(); 269 270 270 break; 271 271 272 272 case 'delete': … … 291 291 wp_die( __( 'Error in deleting.' ) ); 292 292 } 293 293 294 wp_redirect( add_query_arg('deleted', 1, $sendback) ); 295 exit(); 294 if ( wp_redirect( add_query_arg('deleted', 1, $sendback) ) ) 295 exit(); 296 296 297 break; 297 298 298 299 case 'preview': … … 300 301 301 302 $url = post_preview(); 302 303 303 wp_redirect($url); 304 exit(); 304 if ( wp_redirect( $url ) ) 305 exit(); 306 305 307 break; 306 308 307 309 default: 308 wp_redirect( admin_url('edit.php') ); 309 exit(); 310 if ( wp_redirect( admin_url('edit.php') ) ) 311 exit(); 312 310 313 break; 311 314 } // end switch 312 315 include('./admin-footer.php'); -
wp-admin/revision.php
75 75 if ( ! $redirect && empty( $post->post_type ) ) 76 76 $redirect = 'edit.php'; 77 77 78 if ( ! empty( $redirect ) ) { 79 wp_redirect( $redirect ); 78 if ( ! empty( $redirect ) && wp_redirect( $redirect ) ) 80 79 exit; 81 }82 80 83 81 // This is so that the correct "Edit" menu item is selected. 84 82 if ( ! empty( $post->post_type ) && 'post' != $post->post_type ) -
wp-admin/theme-editor.php
10 10 require_once('./admin.php'); 11 11 12 12 if ( is_multisite() && ! is_network_admin() ) { 13 wp_redirect( network_admin_url( 'theme-editor.php' ) );14 exit();13 if ( wp_redirect( network_admin_url( 'theme-editor.php' ) ) ) 14 exit(); 15 15 } 16 16 17 17 if ( !current_user_can('edit_themes') ) … … 90 90 $theme->cache_delete(); 91 91 } 92 92 } 93 wp_redirect( $location ); 94 exit; 93 94 if ( wp_redirect( $location ) ) 95 exit; 95 96 break; 96 97 97 98 default: -
wp-admin/theme-install.php
16 16 wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) ); 17 17 18 18 if ( is_multisite() && ! is_network_admin() ) { 19 wp_redirect( network_admin_url( 'theme-install.php' ) );20 exit();19 if ( wp_redirect( network_admin_url( 'theme-install.php' ) ) ) 20 exit(); 21 21 } 22 22 23 23 $wp_list_table = _get_list_table('WP_Theme_Install_List_Table'); -
wp-admin/themes.php
21 21 if ( ! $theme->exists() || ! $theme->is_allowed() ) 22 22 wp_die( __( 'Cheatin’ uh?' ) ); 23 23 switch_theme( $theme->get_stylesheet() ); 24 wp_redirect( admin_url('themes.php?activated=true') );25 exit;24 if ( wp_redirect( admin_url('themes.php?activated=true') ) ) 25 exit; 26 26 } elseif ( 'delete' == $_GET['action'] ) { 27 27 check_admin_referer('delete-theme_' . $_GET['stylesheet']); 28 28 $theme = wp_get_theme( $_GET['stylesheet'] ); 29 29 if ( !current_user_can('delete_themes') || ! $theme->exists() ) 30 30 wp_die( __( 'Cheatin’ uh?' ) ); 31 31 delete_theme($_GET['stylesheet']); 32 wp_redirect( admin_url('themes.php?deleted=true') );33 exit;32 if ( wp_redirect( admin_url('themes.php?deleted=true') ) ) 33 exit; 34 34 } 35 35 } 36 36 -
wp-admin/update-core.php
14 14 add_thickbox(); 15 15 16 16 if ( is_multisite() && ! is_network_admin() ) { 17 wp_redirect( network_admin_url( 'update-core.php' ) );18 exit();17 if ( wp_redirect( network_admin_url( 'update-core.php' ) ) ) 18 exit(); 19 19 } 20 20 21 21 if ( ! current_user_can( 'update_core' ) && ! current_user_can( 'update_themes' ) && ! current_user_can( 'update_plugins' ) ) … … 371 371 if ( !$update ) 372 372 return; 373 373 dismiss_core_update( $update ); 374 wp_redirect( wp_nonce_url('update-core.php?action=upgrade-core', 'upgrade-core') );375 exit;374 if ( wp_redirect( wp_nonce_url('update-core.php?action=upgrade-core', 'upgrade-core') ) ) 375 exit; 376 376 } 377 377 378 378 function do_undismiss_core_update() { … … 382 382 if ( !$update ) 383 383 return; 384 384 undismiss_core_update( $version, $locale ); 385 wp_redirect( wp_nonce_url('update-core.php?action=upgrade-core', 'upgrade-core') );386 exit;385 if ( wp_redirect( wp_nonce_url('update-core.php?action=upgrade-core', 'upgrade-core') ) ) 386 exit; 387 387 } 388 388 389 389 function no_update_actions($actions) { … … 495 495 } elseif ( isset( $_POST['checked'] ) ) { 496 496 $plugins = (array) $_POST['checked']; 497 497 } else { 498 wp_redirect( admin_url('update-core.php') );499 exit;498 if ( wp_redirect( admin_url('update-core.php') ) ) 499 exit; 500 500 } 501 501 502 502 $url = 'update.php?action=update-selected&plugins=' . urlencode(implode(',', $plugins)); … … 524 524 } elseif ( isset( $_POST['checked'] ) ) { 525 525 $themes = (array) $_POST['checked']; 526 526 } else { 527 wp_redirect( admin_url('update-core.php') );528 exit;527 if ( wp_redirect( admin_url('update-core.php') ) ) 528 exit; 529 529 } 530 530 531 531 $url = 'update.php?action=update-selected-themes&themes=' . urlencode(implode(',', $themes)); -
wp-admin/update.php
70 70 71 71 check_admin_referer('activate-plugin_' . $plugin); 72 72 if ( ! isset($_GET['failure']) && ! isset($_GET['success']) ) { 73 wp_redirect( admin_url('update.php?action=activate-plugin&failure=true&plugin=' . urlencode( $plugin ) . '&_wpnonce=' . $_GET['_wpnonce']) ); 73 if ( wp_redirect( admin_url( 'update.php?action=activate-plugin&failure=true&plugin=' . urlencode( $plugin ) . '&_wpnonce=' . $_GET['_wpnonce']) ) ) 74 die(); 74 75 activate_plugin( $plugin, '', ! empty( $_GET['networkwide'] ), true ); 75 wp_redirect( admin_url('update.php?action=activate-plugin&success=true&plugin=' . urlencode( $plugin ) . '&_wpnonce=' . $_GET['_wpnonce']) );76 die();76 if ( wp_redirect( admin_url('update.php?action=activate-plugin&success=true&plugin=' . urlencode( $plugin ) . '&_wpnonce=' . $_GET['_wpnonce']) ) ) 77 die(); 77 78 } 78 79 iframe_header( __('Plugin Reactivation'), true ); 79 80 if ( isset($_GET['success']) ) -
wp-admin/upload.php
87 87 } 88 88 89 89 $location = add_query_arg( array( 'attached' => $attached ) , $location ); 90 wp_redirect( $location );91 exit;90 if ( wp_redirect( $location ) ) 91 exit; 92 92 } 93 93 break; 94 94 case 'trash': … … 129 129 break; 130 130 } 131 131 132 wp_redirect( $location );133 exit;132 if ( wp_redirect( $location ) ) 133 exit; 134 134 } elseif ( ! empty( $_GET['_wp_http_referer'] ) ) { 135 wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );136 exit;135 if ( wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) ) 136 exit; 137 137 } 138 138 139 139 $wp_list_table->prepare_items(); -
wp-admin/user/admin.php
11 11 12 12 require_once( dirname(dirname(__FILE__)) . '/admin.php'); 13 13 14 if ( ! is_multisite() ) { 15 wp_redirect( admin_url() ); 14 if ( ! is_multisite() && wp_redirect( admin_url() ) ) 16 15 exit; 17 }18 16 19 17 $redirect_user_admin_request = ( ( $current_blog->domain != $current_site->domain ) || ( $current_blog->path != $current_site->path ) ); 20 18 $redirect_user_admin_request = apply_filters( 'redirect_user_admin_request', $redirect_user_admin_request ); 21 if ( $redirect_user_admin_request ) { 22 wp_redirect( user_admin_url() ); 19 if ( $redirect_user_admin_request && wp_redirect( user_admin_url() ) ) 23 20 exit; 24 } 21 25 22 unset( $redirect_user_admin_request ); -
wp-admin/user-edit.php
89 89 $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $user->user_email, $current_user->user_login ) ); 90 90 wp_update_user( $user ); 91 91 delete_option( $current_user->ID . '_new_email' ); 92 wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) );93 die();92 if ( wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) ) ) 93 die(); 94 94 } 95 95 } elseif ( is_multisite() && IS_PROFILE_PAGE && !empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' == $_GET['dismiss'] ) { 96 96 delete_option( $current_user->ID . '_new_email' ); 97 wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) );98 die();97 if ( wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) ) ) 98 die(); 99 99 } 100 100 101 101 switch ($action) { … … 143 143 $redirect = add_query_arg( 'updated', true, get_edit_user_link( $user_id ) ); 144 144 if ( $wp_http_referer ) 145 145 $redirect = add_query_arg('wp_http_referer', urlencode($wp_http_referer), $redirect); 146 wp_redirect($redirect);147 exit;146 if ( wp_redirect( $redirect ) _ 147 exit; 148 148 } 149 149 150 150 default: -
wp-admin/user-new.php
47 47 if ( is_super_admin() ) { 48 48 $user_details = get_user_by('login', $_REQUEST[ 'email' ]); 49 49 } else { 50 wp_redirect( add_query_arg( array('update' => 'enter_email'), 'user-new.php' ) );51 die();50 if ( wp_redirect( add_query_arg( array('update' => 'enter_email'), 'user-new.php' ) ) ) 51 die(); 52 52 } 53 53 } 54 54 55 if ( ! $user_details ) {56 wp_redirect( add_query_arg( array('update' => 'does_not_exist'), 'user-new.php' ) );57 die();55 if ( ! $user_details ) { 56 if ( wp_redirect( add_query_arg( array('update' => 'does_not_exist'), 'user-new.php' ) ) ) 57 die(); 58 58 } 59 59 60 60 if ( ! current_user_can('promote_user', $user_details->ID) ) … … 89 89 $redirect = add_query_arg( array('update' => 'add'), 'user-new.php' ); 90 90 } 91 91 } 92 wp_redirect( $redirect );93 die();92 if ( wp_redirect( $redirect ) ) 93 die(); 94 94 } elseif ( isset($_REQUEST['action']) && 'createuser' == $_REQUEST['action'] ) { 95 95 check_admin_referer( 'create-user', '_wpnonce_create-user' ); 96 96 … … 107 107 $redirect = 'users.php?update=add&id=' . $user_id; 108 108 else 109 109 $redirect = add_query_arg( 'update', 'add', 'user-new.php' ); 110 wp_redirect( $redirect );111 die();110 if ( wp_redirect( $redirect ) ) 111 die(); 112 112 } 113 113 } else { 114 114 // Adding a new user to this blog … … 128 128 } else { 129 129 $redirect = add_query_arg( array('update' => 'newuserconfirmation'), 'user-new.php' ); 130 130 } 131 wp_redirect( $redirect );132 die();131 if ( wp_redirect( $redirect ) ) 132 die(); 133 133 } 134 134 } 135 135 } -
wp-admin/users.php
103 103 if ( ! current_user_can( 'promote_users' ) ) 104 104 wp_die( __( 'You can’t edit that user.' ) ); 105 105 106 if ( empty($_REQUEST['users']) ) { 107 wp_redirect($redirect); 106 if ( empty($_REQUEST['users']) && wp_redirect( $redirect ) ) 108 107 exit(); 109 }110 108 111 109 $editable_roles = get_editable_roles(); 112 110 if ( empty( $editable_roles[$_REQUEST['new_role']] ) ) … … 134 132 $user->set_role($_REQUEST['new_role']); 135 133 } 136 134 137 wp_redirect(add_query_arg('update', $update, $redirect));138 exit();135 if ( wp_redirect( add_query_arg( 'update', $update, $redirect ) ) ) 136 exit(); 139 137 140 138 break; 141 139 … … 145 143 146 144 check_admin_referer('delete-users'); 147 145 148 if ( empty($_REQUEST['users']) ) { 149 wp_redirect($redirect); 146 if ( empty($_REQUEST['users'] ) && wp_redirect( $redirect ) ) 150 147 exit(); 151 }152 148 153 149 $userids = array_map( 'intval', (array) $_REQUEST['users'] ); 154 150 155 151 if ( empty( $_REQUEST['delete_option'] ) ) { 156 152 $url = self_admin_url( 'users.php?action=delete&users[]=' . implode( '&users[]=', $userids ) . '&error=true' ); 157 153 $url = str_replace( '&', '&', wp_nonce_url( $url, 'bulk-users' ) ); 158 wp_redirect( $url );159 exit;154 if ( wp_redirect( $url ) ) 155 exit; 160 156 } 161 157 162 158 if ( ! current_user_can( 'delete_users' ) ) … … 185 181 } 186 182 187 183 $redirect = add_query_arg( array('delete_count' => $delete_count, 'update' => $update), $redirect); 188 wp_redirect($redirect);189 exit();184 if ( wp_redirect( $redirect ) ) 185 exit(); 190 186 191 187 break; 192 188 … … 197 193 check_admin_referer('bulk-users'); 198 194 199 195 if ( empty($_REQUEST['users']) && empty($_REQUEST['user']) ) { 200 wp_redirect($redirect);201 exit();196 if ( wp_redirect( $redirect ) ) 197 exit(); 202 198 } 203 199 204 200 if ( ! current_user_can( 'delete_users' ) ) … … 266 262 if ( ! is_multisite() ) 267 263 wp_die( __( 'You can’t remove users.' ) ); 268 264 269 if ( empty($_REQUEST['users']) ) { 270 wp_redirect($redirect); 265 if ( empty($_REQUEST['users']) && wp_redirect( $redirect ) ) 271 266 exit; 272 }273 267 274 268 if ( ! current_user_can( 'remove_users' ) ) 275 269 wp_die( __( 'You can’t remove users.' ) ); … … 291 285 } 292 286 293 287 $redirect = add_query_arg( array('update' => $update), $redirect); 294 wp_redirect($redirect);295 exit;288 if ( wp_redirect( $redirect ) ) 289 exit; 296 290 297 291 break; 298 292 … … 304 298 wp_die( __( 'You can’t remove users.' ) ); 305 299 306 300 if ( empty($_REQUEST['users']) && empty($_REQUEST['user']) ) { 307 wp_redirect($redirect);308 exit();301 if ( wp_redirect( $redirect ) ) 302 exit(); 309 303 } 310 304 311 305 if ( !current_user_can('remove_users') ) … … 356 350 357 351 default: 358 352 359 if ( ! empty($_GET['_wp_http_referer']) ) {360 wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce'), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );361 exit;353 if ( ! empty($_GET['_wp_http_referer'] ) ) { 354 if ( wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce'), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) ) 355 exit; 362 356 } 363 357 364 358 $wp_list_table->prepare_items(); 365 359 $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); 366 360 if ( $pagenum > $total_pages && $total_pages > 0 ) { 367 wp_redirect( add_query_arg( 'paged', $total_pages ) );368 exit;361 if ( wp_redirect( add_query_arg( 'paged', $total_pages ) ) ) 362 exit; 369 363 } 370 364 371 365 include('./admin-header.php'); -
wp-admin/widgets.php
138 138 // delete 139 139 if ( isset($_POST['removewidget']) && $_POST['removewidget'] ) { 140 140 141 if ( ! in_array($widget_id, $sidebar, true) ) {142 wp_redirect( admin_url('widgets.php?error=0') );143 exit;141 if ( ! in_array( $widget_id, $sidebar, true ) ) { 142 if ( wp_redirect( admin_url( 'widgets.php?error=0' ) ) ) 143 exit; 144 144 } 145 145 146 146 $sidebar = array_diff( $sidebar, array($widget_id) ); … … 172 172 } 173 173 174 174 wp_set_sidebars_widgets($sidebars_widgets); 175 wp_redirect( admin_url('widgets.php?message=0') );176 exit;175 if ( wp_redirect( admin_url( 'widgets.php?message=0' ) ) ) 176 exit; 177 177 } 178 178 179 179 // Output the widget form without js -
wp-includes/canonical.php
248 248 ); 249 249 if ( isset( $old_feed_files[ basename( $redirect['path'] ) ] ) ) { 250 250 $redirect_url = get_feed_link( $old_feed_files[ basename( $redirect['path'] ) ] ); 251 wp_redirect( $redirect_url, 301 );252 die();251 if ( wp_redirect( $redirect_url, 301 ) ) 252 die(); 253 253 } 254 254 } 255 255 … … 285 285 $redirect_url = apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) ); 286 286 else 287 287 $redirect_url = site_url( 'wp-login.php?action=register' ); 288 wp_redirect( $redirect_url, 301 ); 289 die(); 288 289 if ( wp_redirect( $redirect_url, 301 ) ) 290 die(); 290 291 } 291 292 } 292 293 … … 426 427 427 428 if ( $do_redirect ) { 428 429 // protect against chained redirects 429 if ( ! redirect_canonical($redirect_url, false) ) {430 wp_redirect($redirect_url, 301);431 exit();430 if ( ! redirect_canonical( $redirect_url, false ) ) { 431 if ( wp_redirect( $redirect_url, 301 ) ) 432 exit(); 432 433 } else { 433 434 // Debug 434 435 // die("1: $redirect_url<br />2: " . redirect_canonical( $redirect_url, false ) ); … … 518 519 site_url( 'admin', 'relative' ), 519 520 ); 520 521 if ( in_array( untrailingslashit( $_SERVER['REQUEST_URI'] ), $admins ) ) { 521 wp_redirect( admin_url() );522 exit;522 if ( wp_redirect( admin_url() ) ) 523 exit; 523 524 } 524 525 525 526 $logins = array( … … 528 529 site_url( 'login', 'relative' ), 529 530 ); 530 531 if ( in_array( untrailingslashit( $_SERVER['REQUEST_URI'] ), $logins ) ) { 531 wp_redirect( site_url( 'wp-login.php', 'login' ) );532 exit;532 if ( wp_redirect( site_url( 'wp-login.php', 'login' ) ) ) 533 exit; 533 534 } 534 535 } 535 536 -
wp-includes/class-wp-customize-manager.php
148 148 */ 149 149 function after_setup_theme() { 150 150 if ( ! $this->doing_ajax() && ! validate_current_theme() ) { 151 wp_redirect( 'themes.php?broken=true' );152 exit;151 if ( wp_redirect( 'themes.php?broken=true' ) ) 152 exit; 153 153 } 154 154 } 155 155 -
wp-includes/cron.php
230 230 set_transient( 'doing_cron', $doing_wp_cron ); 231 231 232 232 ob_start(); 233 wp_redirect( add_query_arg( 'doing_wp_cron', $doing_wp_cron, wp_unslash( $_SERVER['REQUEST_URI'] ) ) );233 if ( wp_redirect( add_query_arg( 'doing_wp_cron', $doing_wp_cron, wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) ) 234 234 echo ' '; 235 235 236 236 // flush any buffers and send the headers -
wp-includes/load.php
431 431 require( ABSPATH . WPINC . '/kses.php' ); 432 432 require( ABSPATH . WPINC . '/pluggable.php' ); 433 433 require( ABSPATH . WPINC . '/formatting.php' ); 434 wp_redirect( $link );435 die();434 if ( wp_redirect( $link ) ) 435 die(); 436 436 } 437 437 } 438 438 -
wp-includes/ms-functions.php
1616 1616 if ( is_main_site() && is_404() && defined( 'NOBLOGREDIRECT' ) && ( $destination = apply_filters( 'blog_redirect_404', NOBLOGREDIRECT ) ) ) { 1617 1617 if ( $destination == '%siteurl%' ) 1618 1618 $destination = network_home_url(); 1619 wp_redirect( $destination );1620 exit();1619 if ( wp_redirect( $destination ) ) 1620 exit(); 1621 1621 } 1622 1622 } 1623 1623 -
wp-includes/pluggable.php
750 750 // If https is required and request is http, redirect 751 751 if ( $secure && !is_ssl() && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) { 752 752 if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) { 753 wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );754 exit();753 if ( wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) ) ) 754 exit(); 755 755 } else { 756 wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );757 exit();756 if ( wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ) ) 757 exit(); 758 758 } 759 759 } 760 760 … … 769 769 // If the user wants ssl but the session is not ssl, redirect. 770 770 if ( !$secure && get_user_option('use_ssl', $user_id) && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) { 771 771 if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) { 772 wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );773 exit();772 if ( wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) ) ) 773 exit(); 774 774 } else { 775 wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );776 exit();775 if ( wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ) ) 776 exit(); 777 777 } 778 778 } 779 779 … … 787 787 788 788 $login_url = wp_login_url($redirect, true); 789 789 790 wp_redirect($login_url);791 exit();790 if ( wp_redirect( $login_url ) ) 791 exit(); 792 792 } 793 793 endif; 794 794 -
wp-includes/query.php
3650 3650 if ( !$link ) 3651 3651 return; 3652 3652 3653 wp_redirect( $link, 301 ); // Permanent redirect 3654 exit; 3653 // Permanent redirect 3654 if ( wp_redirect( $link, 301 ) ) 3655 exit; 3655 3656 endif; 3656 3657 } 3657 3658 -
wp-login.php
14 14 // Redirect to https login if forced to use SSL 15 15 if ( force_ssl_admin() && ! is_ssl() ) { 16 16 if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) { 17 wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );18 exit();17 if ( wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) ) ) 18 exit(); 19 19 } else { 20 wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );21 exit();20 if ( wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ) ) 21 exit(); 22 22 } 23 23 } 24 24 … … 476 476 $user = check_password_reset_key($_GET['key'], $_GET['login']); 477 477 478 478 if ( is_wp_error($user) ) { 479 wp_redirect( site_url('wp-login.php?action=lostpassword&error=invalidkey') );480 exit;479 if ( wp_redirect( site_url('wp-login.php?action=lostpassword&error=invalidkey') ) ) 480 exit; 481 481 } 482 482 483 483 $errors = new WP_Error(); … … 533 533 case 'register' : 534 534 if ( is_multisite() ) { 535 535 // Multisite uses wp-signup.php 536 wp_redirect( apply_filters( 'wp_signup_location', network_site_url('wp-signup.php') ) );537 exit;536 if ( wp_redirect( apply_filters( 'wp_signup_location', network_site_url('wp-signup.php') ) ) ) 537 exit; 538 538 } 539 539 540 if ( ! get_option('users_can_register') ) {541 wp_redirect( site_url('wp-login.php?registration=disabled') );542 exit();540 if ( ! get_option( 'users_can_register' ) ) { 541 if ( wp_redirect( site_url( 'wp-login.php?registration=disabled' ) ) ) 542 exit(); 543 543 } 544 544 545 545 $user_login = ''; … … 550 550 $errors = register_new_user($user_login, $user_email); 551 551 if ( !is_wp_error($errors) ) { 552 552 $redirect_to = !empty( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : 'wp-login.php?checkemail=registered'; 553 wp_safe_redirect( $redirect_to );554 exit();553 if ( wp_safe_redirect( $redirect_to ) ) 554 exit(); 555 555 } 556 556 } 557 557 -
wp-signup.php
8 8 require( './wp-blog-header.php' ); 9 9 10 10 if ( is_array( get_site_option( 'illegal_names' )) && isset( $_GET[ 'new' ] ) && in_array( $_GET[ 'new' ], get_site_option( 'illegal_names' ) ) == true ) { 11 wp_redirect( network_home_url() );12 die();11 if ( wp_redirect( network_home_url() ) ) 12 die(); 13 13 } 14 14 15 15 /** … … 22 22 } 23 23 add_action( 'wp_head', 'do_signup_header' ); 24 24 25 if ( !is_multisite() ) { 26 wp_redirect( site_url('wp-login.php?action=register') ); 25 if ( ! is_multisite() && wp_redirect( site_url( 'wp-login.php?action=register' ) ) ) 27 26 die(); 28 }29 27 30 if ( !is_main_site() ) { 31 wp_redirect( network_site_url( 'wp-signup.php' ) ); 28 if ( ! is_main_site() && wp_redirect( network_site_url( 'wp-signup.php' ) ) ) 32 29 die(); 33 }34 30 35 31 // Fix for page title 36 32 $wp_query->is_404 = false; -
wp-trackback.php
75 75 if ( !isset($tb_id) || !intval( $tb_id ) ) 76 76 trackback_response(1, 'I really need an ID for this to work.'); 77 77 78 if ( empty($title) && empty($tb_url) && empty($blog_name)) {78 if ( empty( $title ) && empty( $tb_url ) && empty( $blog_name ) ) { 79 79 // If it doesn't look like a trackback at all... 80 wp_redirect(get_permalink($tb_id));81 exit;80 if ( wp_redirect( get_permalink( $tb_id ) ) ) 81 exit; 82 82 } 83 83 84 84 if ( !empty($tb_url) && !empty($title) ) {