cvs: pear /Validate Validate.php
| From: | David Coallier | Date: | Tue, 11 Dec 2007 04:07:49 +0000 |
| Subject: | cvs: pear /Validate Validate.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-49713@lists.php.net to get a copy of this message | ||
davidc Tue Dec 11 04:07:49 2007 UTC
Modified files:
/pear/Validate Validate.php
Log:
- Bugfix #11592
- Removed ? that made the xxx@xxx.[section here optional]
http://cvs.php.net/viewvc.cgi/pear/Validate/Validate.php?r1=1.121&r2=1.122&diff_format=u
Index: pear/Validate/Validate.php
diff -u pear/Validate/Validate.php:1.121 pear/Validate/Validate.php:1.122
--- pear/Validate/Validate.php:1.121 Mon Dec 3 02:55:14 2007
+++ pear/Validate/Validate.php Tue Dec 11 04:07:49 2007
@@ -34,7 +34,7 @@
* @author Amir Mohammad Saied <amir@php.net>
* @copyright 1997-2006 Pierre-Alain Joye,Tomas V.V.Cox,Amir Mohammad Saied
* @license http://www.opensource.org/licenses/bsd-license.php
New BSD License
- * @version CVS: $Id: Validate.php,v 1.121 2007/12/03 02:55:14 thesaur Exp $
+ * @version CVS: $Id: Validate.php,v 1.122 2007/12/11 04:07:49 davidc Exp $
* @link http://pear.php.net/package/Validate
*/
@@ -520,8 +520,6 @@
* @todo Fix bug here.. even if it passes this, it won't be passing
* The regular expression below
*/
-
- $checkTLD = true;
if (isset($fullTLDValidation)) {
$valid = Validate::_fullTLDValidation($email, $fullTLDValidation);
@@ -538,15 +536,9 @@
(?:(?:(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:[0-1]?[0-9]?[0-9]))\.){3}
(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:[0-1]?[0-9]?[0-9]))))(?(5)\])|
((?:[a-z0-9](?:[-a-z0-9]*[a-z0-9])?\.)*[a-z0-9](?:[-a-z0-9]*[a-z0-9])?) #6 domain as
hostname
- ';
-
- if ($checkTLD) {
- $regex .= '\.((?:([^- ])[-a-z]*[-a-z])?)) #7 TLD
- ';
- }
-
- $regex .= '$&xi';
-
+ \.((?:([^- ])[-a-z]*[-a-z]))) #7 TLD
+ $&xi';
+
if ($use_rfc822? Validate::__emailRFC822($email, $options) :
preg_match($regex, $email)) {
if ($check_domain && function_exists('checkdnsrr')) {
@@ -561,7 +553,7 @@
return false;
}
- /**
+ /**
* Validate a string using the given format 'format'
*
* @param string $string String to validate