Ticket #12282: redirect-2.patch
| File redirect-2.patch, 2.8 KB (added by , 16 years ago) |
|---|
-
wp-login.php
372 372 case 'retrievepassword' : 373 373 if ( $http_post ) { 374 374 $errors = retrieve_password(); 375 if ( !is_wp_error($errors) ) { 376 wp_redirect('wp-login.php?checkemail=confirm'); 377 exit(); 378 } 375 if ( !is_wp_error($errors) ) { 376 if ( isset( $_REQUEST['redirect_to'] ) ) { 377 wp_safe_redirect($_REQUEST['redirect_to']); 378 } else { 379 wp_redirect('wp-login.php?checkemail=confirm'); 380 } 381 exit(); 382 } 379 383 } 380 384 381 385 if ( isset($_GET['error']) && 'invalidkey' == $_GET['error'] ) $errors->add('invalidkey', __('Sorry, that key does not appear to be valid.')); 382 386 387 if ( isset( $_REQUEST['redirect_to'] ) ) { 388 $redirect_to = $_REQUEST['redirect_to']; 389 } else { 390 $redirect_to = ''; 391 } 392 $redirect_to = apply_filters('lostpassword_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : ''); 393 383 394 do_action('lost_password'); 384 395 login_header(__('Lost Password'), '<p class="message">' . __('Please enter your username or e-mail address. You will receive a new password via e-mail.') . '</p>', $errors); 385 396 … … 394 405 </p> 395 406 <?php do_action('lostpassword_form'); ?> 396 407 <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Get New Password'); ?>" tabindex="100" /></p> 408 <input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>" /> 397 409 </form> 398 410 399 411 <p id="nav"> … … 452 464 $user_login = $_POST['user_login']; 453 465 $user_email = $_POST['user_email']; 454 466 $errors = register_new_user($user_login, $user_email); 455 if ( !is_wp_error($errors) ) { 456 wp_redirect('wp-login.php?checkemail=registered'); 457 exit(); 458 } 467 if ( !is_wp_error($errors) ) { 468 if ( isset( $_REQUEST['redirect_to'] ) ) { 469 wp_safe_redirect($_REQUEST['redirect_to']); 470 } else { 471 wp_redirect('wp-login.php?checkemail=registered'); 472 } 473 exit(); 474 } 459 475 } 460 476 477 if ( isset( $_REQUEST['redirect_to'] ) ) { 478 $redirect_to = $_REQUEST['redirect_to']; 479 } else { 480 $redirect_to = ''; 481 } 482 $redirect_to = apply_filters('registration_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : ''); 483 461 484 login_header(__('Registration Form'), '<p class="message register">' . __('Register For This Site') . '</p>', $errors); 462 485 ?> 463 486 … … 474 497 <p id="reg_passmail"><?php _e('A password will be e-mailed to you.') ?></p> 475 498 <br class="clear" /> 476 499 <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Register'); ?>" tabindex="100" /></p> 500 <input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>" /> 477 501 </form> 478 502 479 503 <p id="nav">