Changeset 1545

Show
Ignore:
Timestamp:
12/16/2007 02:39:45 AM (13 months ago)
Author:
armen
Message:

Removed auto determination of delimiter.
*BC Break*: You have to add proper delimiters for regex validator

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/libraries/Validation.php

    r1536 r1545  
    11751175                        $regex = current($regex); 
    11761176 
    1177                         // Find a usable delimiter 
    1178                         foreach (str_split('~#|!:;,./=-+*?\'"$', 1) as $delim) 
    1179                         { 
    1180                                 if (strpos($regex, $delim) === FALSE) 
    1181                                 { 
    1182                                         if (preg_match($delim.$regex.$delim, $str)) 
    1183                                         { 
    1184                                                 // Regex matches, return 
    1185                                                 return TRUE; 
    1186                                         } 
    1187                                         break; 
    1188                                 } 
     1177                        if (preg_match($regex, $str)) 
     1178                        { 
     1179                                // Regex matches, return 
     1180                                return TRUE; 
    11891181                        } 
    11901182                }