Changeset 1208

Show
Ignore:
Timestamp:
06/14/08 15:22:45 (3 months ago)
Author:
rats
Message:

* Fixed #1344: Error with LocalPart? address checking

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gui/include/input-checks.php

    r1207 r1208  
    187187 
    188188function chk_email($email, $num = 50) { 
     189        if (strlen($email) > $num) 
     190                return false; 
     191 
    189192        // RegEx begin 
    190193        $nonascii = "\x80-\xff"; # non ASCII chars are not allowed 
     
    204207        $regex = "$user_part\@$domain_part"; 
    205208        // RegEx end 
    206         if (!preg_match("/^$regex$/", $email)) 
    207                 return false; 
    208  
    209         if (strlen($email) > $num) 
    210                 return false; 
    211  
    212         return true; 
     209        return (bool) preg_match("/^$regex$/", $email); 
    213210} 
    214211 
     
    230227        // RegEx end 
    231228        return (bool) preg_match("/^$regex$/", $email); 
    232         return false; 
    233229} 
    234230