Make WordPress Core

Ticket #18658: 0001-Allow-email-addresses-containing-apostrophes.patch

File 0001-Allow-email-addresses-containing-apostrophes.patch, 1.9 KB (added by holizz, 13 years ago)

Unified patch of all three changes, against v3.4.1

  • wp-admin/includes/ms.php

    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 b function send_confirmation_on_profile_email() { 
    236236                $hash = md5( $_POST['email'] . time() . mt_rand() );
    237237                $new_user_email = array(
    238238                                'hash' => $hash,
    239                                 'newemail' => $_POST['email']
     239                                'newemail' => stripslashes( $_POST['email'] )
    240240                                );
    241241                update_option( $current_user->ID . '_new_email', $new_user_email );
    242242
  • wp-admin/includes/user.php

    diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php
    index ff1e91d..c5358f2 100644
    a b function edit_user( $user_id = 0 ) { 
    6363        }
    6464
    6565        if ( isset( $_POST['email'] ))
    66                 $user->user_email = sanitize_text_field( $_POST['email'] );
     66                $user->user_email = sanitize_text_field( stripslashes( $_POST['email'] ) );
    6767        if ( isset( $_POST['url'] ) ) {
    6868                if ( empty ( $_POST['url'] ) || $_POST['url'] == 'http://' ) {
    6969                        $user->user_url = '';
  • wp-login.php

    diff --git a/wp-login.php b/wp-login.php
    index 50088db..068f3d5 100644
    a b case 'register' : 
    522522        $user_email = '';
    523523        if ( $http_post ) {
    524524                $user_login = $_POST['user_login'];
    525                 $user_email = $_POST['user_email'];
     525                $user_email = stripslashes( $_POST['user_email'] );
    526526                $errors = register_new_user($user_login, $user_email);
    527527                if ( !is_wp_error($errors) ) {
    528528                        $redirect_to = !empty( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : 'wp-login.php?checkemail=registered';