From a5c7593856bcc4dd978c537dab3daa86485833e9 Mon Sep 17 00:00:00 2001
From: Tom Adams <tom@dxw.com>
Date: Fri, 20 Jul 2012 10:46:47 -0400
Subject: [PATCH] Allow email addresses containing apostrophes

---
 wp-admin/includes/ms.php   |    2 +-
 wp-admin/includes/user.php |    2 +-
 wp-login.php               |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/wp-admin/includes/ms.php b/wp-admin/includes/ms.php
index a6828b2..f874c38 100644
--- a/wp-admin/includes/ms.php
+++ b/wp-admin/includes/ms.php
@@ -236,7 +236,7 @@ function send_confirmation_on_profile_email() {
 		$hash = md5( $_POST['email'] . time() . mt_rand() );
 		$new_user_email = array(
 				'hash' => $hash,
-				'newemail' => $_POST['email']
+				'newemail' => stripslashes( $_POST['email'] )
 				);
 		update_option( $current_user->ID . '_new_email', $new_user_email );
 
diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php
index ff1e91d..c5358f2 100644
--- a/wp-admin/includes/user.php
+++ b/wp-admin/includes/user.php
@@ -63,7 +63,7 @@ function edit_user( $user_id = 0 ) {
 	}
 
 	if ( isset( $_POST['email'] ))
-		$user->user_email = sanitize_text_field( $_POST['email'] );
+		$user->user_email = sanitize_text_field( stripslashes( $_POST['email'] ) );
 	if ( isset( $_POST['url'] ) ) {
 		if ( empty ( $_POST['url'] ) || $_POST['url'] == 'http://' ) {
 			$user->user_url = '';
diff --git a/wp-login.php b/wp-login.php
index 50088db..068f3d5 100644
--- a/wp-login.php
+++ b/wp-login.php
@@ -522,7 +522,7 @@ case 'register' :
 	$user_email = '';
 	if ( $http_post ) {
 		$user_login = $_POST['user_login'];
-		$user_email = $_POST['user_email'];
+		$user_email = stripslashes( $_POST['user_email'] );
 		$errors = register_new_user($user_login, $user_email);
 		if ( !is_wp_error($errors) ) {
 			$redirect_to = !empty( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : 'wp-login.php?checkemail=registered';
-- 
1.7.9.5

