Make WordPress Core

Changeset 3507 for trunk/wp-register.php


Ignore:
Timestamp:
02/09/2006 08:11:26 AM (21 years ago)
Author:
matt
Message:

Better email error checking, fixes #2046

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-register.php

    r3481 r3507  
    3434                $errors['user_login'] = __('<strong>ERROR</strong>: This username is already registered, please choose another one.');
    3535
    36         /* checking the email isn't already used by another user */
    37         $email_exists = $wpdb->get_row("SELECT user_email FROM $wpdb->users WHERE user_email = '$user_email'");
    38         if ( $email_exists)
    39                 die (__('<strong>ERROR</strong>: This email address is already registered, please supply another.'));
     36        if ( email_exists( $user_email ) )
     37                $errors['user_email'] = __('<strong>ERROR</strong>: This email is already registered, please choose another one.');
    4038
    4139        if ( 0 == count($errors) ) {
     
    5048       
    5149        if ( 0 == count($errors) ) {
    52                        
     50
    5351        ?>
    5452<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    102100<?php if ( isset($errors) ) : ?>
    103101<div class="error">
    104         <ul>
     102        <p>
    105103        <?php
    106         foreach($errors as $error) echo "<li>$error</li>";
     104        foreach($errors as $error) echo "$error<br />";
    107105        ?>
    108         </ul>
     106        </p>
    109107</div>
    110108<?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.