Changeset 2611

Show
Ignore:
Timestamp:
12/06/07 13:17:32 (5 years ago)
Author:
tasuku
Message:

r339@dhcp158 (orig r82): tasuku | 2007-11-13 12:06:24 +0900
chotto naosita email check


Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/php/mumu/trunk/mumu.php

    r2610 r2611  
    110110    header("Location: http://$host%uri/$rel_path"); 
    111111  } 
    112   public static function check_email($email, $dns = false, $strict = false/* , $quote = false */) { 
     112  // simple logic for validation of email address 
     113  public static function validate_email($email, $dns = false, $strict = false/* , $quote = false */) { 
    113114    // TODO: quoted localpart 
    114115    if (($at = strrpos($email, '@')) === false) { 
     
    122123        !preg_match('/^[A-Za-z0-9\\-\\.]+$/', $domain) || 
    123124        preg_match('/\\.\\./', $domain) || 
    124         !preg_match('/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/', 
     125        !preg_match('/^(\\\\[\\x00-\\x7e]|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/', 
    125126                    $local) || 
    126127        // strict check(dot)