Index: wp-login.php
===================================================================
--- wp-login.php	(revision 13356)
+++ wp-login.php	(working copy)
@@ -422,8 +422,12 @@
 case 'rp' :
 	$errors = reset_password($_GET['key'], $_GET['login']);
 
-	if ( ! is_wp_error($errors) ) {
-		wp_redirect('wp-login.php?checkemail=newpass');
+	if ( !is_wp_error($errors) ) {
+		if ( isset( $_REQUEST['redirect_to'] ) ) {
+			wp_safe_redirect($_REQUEST['redirect_to']);
+		} else {
+			wp_redirect('wp-login.php?checkemail=newpass');
+		}
 		exit();
 	}
 
@@ -452,10 +456,14 @@
 		$user_login = $_POST['user_login'];
 		$user_email = $_POST['user_email'];
 		$errors = register_new_user($user_login, $user_email);
-		if ( !is_wp_error($errors) ) {
-			wp_redirect('wp-login.php?checkemail=registered');
-			exit();
-		}
+    	if ( !is_wp_error($errors) ) {
+    		if ( isset( $_REQUEST['redirect_to'] ) ) {
+    			wp_safe_redirect($_REQUEST['redirect_to']);
+    		} else {
+    			wp_redirect('wp-login.php?checkemail=registered');
+    		}
+    		exit();
+    	}
 	}
 
 	login_header(__('Registration Form'), '<p class="message register">' . __('Register For This Site') . '</p>', $errors);
