Ticket #15965: 15965.patch
File 15965.patch, 17.0 KB (added by , 13 years ago) |
---|
-
wp-includes/canonical.php
### Eclipse Workspace Patch 1.0 #P wordpress-trunk bare
365 365 // protect against chained redirects 366 366 if ( !redirect_canonical($redirect_url, false) ) { 367 367 wp_redirect($redirect_url, 301); 368 exit ();368 exit; 369 369 } else { 370 370 // Debug 371 371 // die("1: $redirect_url<br />2: " . redirect_canonical( $redirect_url, false ) ); -
wp-admin/includes/class-wp-importer.php
126 126 $blog = 'http://' . preg_replace( '#^https?://#', '', $blog_id ); 127 127 if ( ( !$parsed = parse_url( $blog ) ) || empty( $parsed['host'] ) ) { 128 128 fwrite( STDERR, "Error: can not determine blog_id from $blog_id\n" ); 129 exit ();129 exit; 130 130 } 131 131 if ( empty( $parsed['path'] ) ) 132 132 $parsed['path'] = '/'; 133 133 $blog = get_blog_details( array( 'domain' => $parsed['host'], 'path' => $parsed['path'] ) ); 134 134 if ( !$blog ) { 135 135 fwrite( STDERR, "Error: Could not find blog\n" ); 136 exit ();136 exit; 137 137 } 138 138 $blog_id = (int) $blog->blog_id; 139 139 // Restore global $current_blog … … 158 158 159 159 if ( !$user_id || !wp_set_current_user( $user_id ) ) { 160 160 fwrite( STDERR, "Error: can not find user\n" ); 161 exit ();161 exit; 162 162 } 163 163 164 164 return $user_id; … … 304 304 if ( !isset( $out[$param] ) && $required ) { 305 305 // Display message and exit 306 306 echo "\"$param\" parameter is required but was not specified\n"; 307 exit ();307 exit; 308 308 } 309 309 310 310 return $return; -
wp-admin/admin.php
170 170 171 171 include(ABSPATH . 'wp-admin/admin-footer.php'); 172 172 173 exit ();173 exit; 174 174 } else if (isset($_GET['import'])) { 175 175 176 176 $importer = $_GET['import']; … … 214 214 global $wp_rewrite; 215 215 $wp_rewrite->flush_rules(false); 216 216 217 exit ();217 exit; 218 218 } else { 219 219 do_action("load-$pagenow"); 220 220 // Backwards compatibility with old load-page-new.php, load-page.php, -
wp-admin/update-core.php
11 11 12 12 if ( is_multisite() && ! is_network_admin() ) { 13 13 wp_redirect( network_admin_url( 'update-core.php' ) ); 14 exit ();14 exit; 15 15 } 16 16 17 17 if ( ! current_user_can( 'update_core' ) ) -
wp-admin/media.php
49 49 50 50 if ( empty( $_GET['attachment_id'] ) ) { 51 51 wp_redirect( admin_url('upload.php') ); 52 exit ();52 exit; 53 53 } 54 54 $att_id = (int) $_GET['attachment_id']; 55 55 -
wp-admin/comment.php
275 275 $location = apply_filters( 'comment_edit_redirect', $location, $comment_id ); 276 276 wp_redirect( $location ); 277 277 278 exit ();278 exit; 279 279 break; 280 280 281 281 default: -
wp-admin/network/site-users.php
143 143 144 144 restore_current_blog(); 145 145 wp_redirect( add_query_arg( 'update', $update, wp_get_referer() ) ); 146 exit ();146 exit; 147 147 } 148 148 149 149 if ( isset( $_GET['action'] ) && 'update-site' == $_GET['action'] ) { 150 150 wp_redirect( wp_get_referer() ); 151 exit ();151 exit; 152 152 } 153 153 154 154 add_screen_option( 'per_page', array( 'label' => _x( 'Users', 'users per page (screen options)' ) ) ); -
wp-login.php
15 15 if ( force_ssl_admin() && !is_ssl() ) { 16 16 if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) { 17 17 wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI'])); 18 exit ();18 exit; 19 19 } else { 20 20 wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 21 exit ();21 exit; 22 22 } 23 23 } 24 24 … … 378 378 379 379 $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : 'wp-login.php?loggedout=true'; 380 380 wp_safe_redirect( $redirect_to ); 381 exit ();381 exit; 382 382 383 383 break; 384 384 … … 390 390 if ( !is_wp_error($errors) ) { 391 391 $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : 'wp-login.php?checkemail=confirm'; 392 392 wp_safe_redirect( $redirect_to ); 393 exit ();393 exit; 394 394 } 395 395 } 396 396 … … 490 490 491 491 if ( !get_option('users_can_register') ) { 492 492 wp_redirect( site_url('wp-login.php?registration=disabled') ); 493 exit ();493 exit; 494 494 } 495 495 496 496 $user_login = ''; … … 502 502 if ( !is_wp_error($errors) ) { 503 503 $redirect_to = !empty( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : 'wp-login.php?checkemail=registered'; 504 504 wp_safe_redirect( $redirect_to ); 505 exit ();505 exit; 506 506 } 507 507 } 508 508 … … 591 591 elseif ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) ) 592 592 $redirect_to = admin_url('profile.php'); 593 593 wp_safe_redirect($redirect_to); 594 exit ();594 exit; 595 595 } 596 596 597 597 $errors = $user; -
wp-includes/pluggable.php
768 768 if ( $secure && !is_ssl() && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) { 769 769 if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) { 770 770 wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI'])); 771 exit ();771 exit; 772 772 } else { 773 773 wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 774 exit ();774 exit; 775 775 } 776 776 } 777 777 … … 787 787 if ( !$secure && get_user_option('use_ssl', $user_id) && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) { 788 788 if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) { 789 789 wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI'])); 790 exit ();790 exit; 791 791 } else { 792 792 wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 793 exit ();793 exit; 794 794 } 795 795 } 796 796 … … 810 810 $login_url = wp_login_url($redirect, true); 811 811 812 812 wp_redirect($login_url); 813 exit ();813 exit; 814 814 } 815 815 endif; 816 816 -
wp-admin/users.php
50 50 51 51 if ( empty($_REQUEST['users']) ) { 52 52 wp_redirect($redirect); 53 exit ();53 exit; 54 54 } 55 55 56 56 $editable_roles = get_editable_roles(); … … 79 79 } 80 80 81 81 wp_redirect(add_query_arg('update', $update, $redirect)); 82 exit ();82 exit; 83 83 84 84 break; 85 85 … … 91 91 92 92 if ( empty($_REQUEST['users']) ) { 93 93 wp_redirect($redirect); 94 exit ();94 exit; 95 95 } 96 96 97 97 if ( ! current_user_can( 'delete_users' ) ) … … 126 126 127 127 $redirect = add_query_arg( array('delete_count' => $delete_count, 'update' => $update), $redirect); 128 128 wp_redirect($redirect); 129 exit ();129 exit; 130 130 131 131 break; 132 132 … … 138 138 139 139 if ( empty($_REQUEST['users']) && empty($_REQUEST['user']) ) { 140 140 wp_redirect($redirect); 141 exit ();141 exit; 142 142 } 143 143 144 144 if ( ! current_user_can( 'delete_users' ) ) … … 233 233 234 234 if ( empty($_REQUEST['users']) && empty($_REQUEST['user']) ) { 235 235 wp_redirect($redirect); 236 exit ();236 exit; 237 237 } 238 238 239 239 if ( !current_user_can('remove_users') ) -
wp-admin/network/edit.php
162 162 do_action( 'update_wpmu_options' ); 163 163 164 164 wp_redirect( add_query_arg( 'updated', 'true', network_admin_url( 'settings.php' ) ) ); 165 exit ();165 exit; 166 166 break; 167 167 168 168 case 'updateblog': … … 181 181 wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'not_deleted' ), wp_get_referer() ) ); 182 182 } 183 183 184 exit ();184 exit; 185 185 break; 186 186 187 187 case 'allblogs': … … 226 226 } else { 227 227 wp_redirect( network_admin_url( 'sites.php' ) ); 228 228 } 229 exit ();229 exit; 230 230 break; 231 231 232 232 case 'archiveblog': … … 236 236 237 237 update_blog_status( $id, 'archived', '1' ); 238 238 wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'archive' ), wp_get_referer() ) ); 239 exit ();239 exit; 240 240 break; 241 241 242 242 case 'unarchiveblog': … … 246 246 247 247 update_blog_status( $id, 'archived', '0' ); 248 248 wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'unarchive' ), wp_get_referer() ) ); 249 exit ();249 exit; 250 250 break; 251 251 252 252 case 'activateblog': … … 257 257 update_blog_status( $id, 'deleted', '0' ); 258 258 do_action( 'activate_blog', $id ); 259 259 wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'activate' ), wp_get_referer() ) ); 260 exit ();260 exit; 261 261 break; 262 262 263 263 case 'deactivateblog': … … 268 268 do_action( 'deactivate_blog', $id ); 269 269 update_blog_status( $id, 'deleted', '1' ); 270 270 wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'deactivate' ), wp_get_referer() ) ); 271 exit ();271 exit; 272 272 break; 273 273 274 274 case 'unspamblog': … … 278 278 279 279 update_blog_status( $id, 'spam', '0' ); 280 280 wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'unspam' ), wp_get_referer() ) ); 281 exit ();281 exit; 282 282 break; 283 283 284 284 case 'spamblog': … … 288 288 289 289 update_blog_status( $id, 'spam', '1' ); 290 290 wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'spam' ), wp_get_referer() ) ); 291 exit ();291 exit; 292 292 break; 293 293 294 294 case 'unmatureblog': … … 298 298 299 299 update_blog_status( $id, 'mature', '0' ); 300 300 wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'unmature' ), wp_get_referer() ) ); 301 exit ();301 exit; 302 302 break; 303 303 304 304 case 'matureblog': … … 308 308 309 309 update_blog_status( $id, 'mature', '1' ); 310 310 wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'mature' ), wp_get_referer() ) ); 311 exit ();311 exit; 312 312 break; 313 313 314 314 // Common … … 345 345 </body> 346 346 </html> 347 347 <?php 348 exit ();348 exit; 349 349 break; 350 350 351 351 // Users … … 367 367 } else { 368 368 wp_redirect( network_admin_url( 'users.php' ) ); 369 369 } 370 exit ();370 exit; 371 371 break; 372 372 373 373 case 'allusers': … … 393 393 confirm_delete_users( $_POST['allusers'] ); 394 394 echo '</div>'; 395 395 require_once( '../admin-footer.php' ); 396 exit ();396 exit; 397 397 break; 398 398 399 399 case 'spam': … … 426 426 } else { 427 427 wp_redirect( network_admin_url( 'users.php' ) ); 428 428 } 429 exit ();429 exit; 430 430 break; 431 431 432 432 case 'dodelete': … … 462 462 $deletefunction = 'all_delete'; 463 463 464 464 wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => $deletefunction ), network_admin_url( 'users.php' ) ) ); 465 exit ();465 exit; 466 466 break; 467 467 468 468 default: 469 469 // Let plugins use us as a post handler easily 470 470 do_action( 'network_admin_edit_' . $_GET['action'] ); 471 471 wp_redirect( network_admin_url( 'index.php' ) ); 472 exit ();472 exit; 473 473 break; 474 474 } 475 475 ?> -
wp-admin/theme-editor.php
11 11 12 12 if ( is_multisite() && ! is_network_admin() ) { 13 13 wp_redirect( network_admin_url( 'theme-editor.php' ) ); 14 exit ();14 exit; 15 15 } 16 16 17 17 if ( !current_user_can('edit_themes') ) … … 97 97 $strip = array('%0d', '%0a', '%0D', '%0A'); 98 98 $location = _deep_replace($strip, $location); 99 99 header("Location: $location"); 100 exit ();100 exit; 101 101 102 102 break; 103 103 -
wp-app.php
300 300 301 301 array_shift($matches); 302 302 call_user_func_array(array(&$this,$funcs[$method]), $matches); 303 exit ();303 exit; 304 304 } else { 305 305 // only allow what we have handlers for... 306 306 $this->not_allowed(array_keys($funcs)); -
wp-includes/ms-functions.php
419 419 if ( $ref ) { 420 420 $ref = wpmu_admin_redirect_add_updated_param( $ref ); 421 421 wp_redirect( $ref ); 422 exit ();422 exit; 423 423 } 424 424 if ( empty( $_SERVER['HTTP_REFERER'] ) == false ) { 425 425 wp_redirect( $_SERVER['HTTP_REFERER'] ); 426 exit ();426 exit; 427 427 } 428 428 429 429 $url = wpmu_admin_redirect_add_updated_param( $url ); … … 434 434 $url = wpmu_admin_redirect_add_updated_param( $_POST['redirect'] ); 435 435 } 436 436 wp_redirect( $url ); 437 exit ();437 exit; 438 438 } 439 439 440 440 function wpmu_admin_redirect_add_updated_param( $url = '' ) { … … 1352 1352 if ( $destination == '%siteurl%' ) 1353 1353 $destination = network_home_url(); 1354 1354 wp_redirect( $destination ); 1355 exit ();1355 exit; 1356 1356 } 1357 1357 } 1358 1358 -
wp-admin/plugin-install.php
17 17 18 18 if ( is_multisite() && ! is_network_admin() ) { 19 19 wp_redirect( network_admin_url( 'plugin-install.php' ) ); 20 exit ();20 exit; 21 21 } 22 22 23 23 $wp_list_table = get_list_table('WP_Plugin_Install_List_Table'); -
wp-admin/edit.php
124 124 $sendback = remove_query_arg( array('action', 'action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view'), $sendback ); 125 125 126 126 wp_redirect($sendback); 127 exit ();127 exit; 128 128 } elseif ( ! empty($_REQUEST['_wp_http_referer']) ) { 129 129 wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) ); 130 130 exit; -
wp-admin/network/site-themes.php
106 106 107 107 if ( isset( $_GET['action'] ) && 'update-site' == $_GET['action'] ) { 108 108 wp_redirect( wp_get_referer() ); 109 exit ();109 exit; 110 110 } 111 111 112 112 add_thickbox(); -
wp-admin/plugin-editor.php
11 11 12 12 if ( is_multisite() && ! is_network_admin() ) { 13 13 wp_redirect( network_admin_url( 'plugin-editor.php' ) ); 14 exit ();14 exit; 15 15 } 16 16 17 17 if ( !current_user_can('edit_plugins') ) -
wp-admin/post.php
132 132 } 133 133 134 134 redirect_post($post_id); 135 exit ();135 exit; 136 136 break; 137 137 138 138 case 'edit': … … 140 140 141 141 if ( empty( $post_id ) ) { 142 142 wp_redirect( admin_url('post.php') ); 143 exit ();143 exit; 144 144 } 145 145 146 146 $p = $post_id; … … 205 205 206 206 redirect_post($post_id); // Send user on their way while we keep working 207 207 208 exit ();208 exit; 209 209 break; 210 210 211 211 case 'trash': … … 220 220 wp_die( __('Error in moving to Trash.') ); 221 221 222 222 wp_redirect( add_query_arg( array('trashed' => 1, 'ids' => $post_id), $sendback ) ); 223 exit ();223 exit; 224 224 break; 225 225 226 226 case 'untrash': … … 233 233 wp_die( __('Error in restoring from Trash.') ); 234 234 235 235 wp_redirect( add_query_arg('untrashed', 1, $sendback) ); 236 exit ();236 exit; 237 237 break; 238 238 239 239 case 'delete': … … 253 253 } 254 254 255 255 wp_redirect( add_query_arg('deleted', 1, $sendback) ); 256 exit ();256 exit; 257 257 break; 258 258 259 259 case 'preview': … … 262 262 $url = post_preview(); 263 263 264 264 wp_redirect($url); 265 exit ();265 exit; 266 266 break; 267 267 268 268 default: 269 269 wp_redirect( admin_url('edit.php') ); 270 exit ();270 exit; 271 271 break; 272 272 } // end switch 273 273 include('./admin-footer.php'); -
wp-includes/class-wp.php
371 371 @header("{$name}: {$field_value}"); 372 372 373 373 if ( $exit_required ) 374 exit ();374 exit; 375 375 376 376 do_action_ref_array('send_headers', array(&$this)); 377 377 } -
wp-admin/theme-install.php
17 17 18 18 if ( is_multisite() && ! is_network_admin() ) { 19 19 wp_redirect( network_admin_url( 'theme-install.php' ) ); 20 exit ();20 exit; 21 21 } 22 22 23 23 $wp_list_table = get_list_table('WP_Theme_Install_List_Table');