Home » Validate » Validate
Validation class
This package is unmaintained.
Download latest release 0.8.6 (there is a newer Composer installable version)
License: New BSD
Description
Package to validate various datas. It includes :
- numbers (min/max, decimal or not)
- email (syntax, domain check, rfc822)
- string (predifined type alpha upper and/or lowercase, numeric,...)
- date (min, max, rfc822 compliant)
- uri (RFC2396)
- possibility valid multiple data with a single method call (::multiple)
Documentation
Maintainers
- Pierre-Alain Joye (pajoye) — lead, inactive
- Thomas V.V.Cox (cox) — lead, inactive
- Helgi Þormar Þorbjörnsson (dufuz) — lead, inactive
- Amir Mohammad Saied (amir) — lead, active
- David Coallier (davidc) — lead, active
- bertrand Gugger (toggg) — lead, inactive
- Stefan Neufeind (neufeind) — developer, inactive
Dependencies
Required
- PHP (>= 4.2.0)
- PEAR Installer (>= 1.4.0b1)
Optional
Releases
- 0.8.6 (beta, 2021-07-02)
Release notes
License: New BSD
QA Release
Attempt to fix RFC822 behaviour for mismatched braces
Enhancement: composer setup
Make tests run on PHP 7
Fix PHP 8 compatibility.
Fix test to be skipped if PEAR::Date dependency is missing.
Remove some broken unit tests
Separate the date() check and date() check that requires PEAR::Date
Use correct SPDX license identifier - 0.8.5 (beta, 2011-12-18)
Release notes
License: New BSD
QA Release
Request #17963: Allow test suite to run without DNS resolver [patch by remicollet, adjustments by dufuz]
Bug #17279 Validate::email() with 'fullTLDValidation' => 'true' always return false.
Bug #17947 testdate test fails if date.timezone not set
Bug #17948 multicard test fails - 0.8.4 (beta, 2010-10-10)
Release notes
License: New BSD
QA release
Bug #17555 Use correct pattern delim
Bug #17755 Encoding to UTF-8 in Validate.php
Bug #17756 Avoiding ereg - 0.8.3 (beta, 2009-11-24)
Release notes
License: New BSD
- * Bug #14865 Fixing some unit test failures (amir)
- * Bug #15945 Improper string used to check domain dns (amir)
- * Bug #16381 String format validation fails for VALIDATE_NAME.VALIDATE_XXX (amir)
- * Bug #16427 Email Validation not working for check_domain (amir)
- * Bug #16811 Should determine whether Net/IDNA.php is available less "destructively" (kguest)
- - 0.8.2 (beta, 2009-01-31)
Release notes
License: New BSD
* Bug #12658: New lines at end of file create output (davidc)
* Bug #11001 RFC822 Comments break PCRE (davidc)
* Bug #14075 Validate::uri() rejects valid tag: URIs (davidc)
* Bug #14866 Notice: Undefined index: VALIDATE_ITLD_EMAILS (amir)
* Bug #14931 Warning: max(): Array must contain atleast one element (doconnor)
* Doc Bug #14180 Typo in $modulo variable description (amir)
* Doc Bug #14046 Docs desperately needed (amir)
* Request #956 Validate::email() doesn't allow Internationalized Domain Names (IDN) (davidc)
* Request #14791 Improve PHPCS Results [amir]
* Removed Net_IDNA Dependency [davidc] - 0.8.1 (beta, 2007-12-12)
Release notes
License: New BSD
* Fix Bug #2662: Invalid email addresses are validated [dufuz]
* Fix Bug #2936: Typo in sample_multiple.php [dufuz]
* Fix Bug #4068: errant "return true;" in Validate_US::phoneNumber [dufuz]
* Fix Bug #5390: XML Package Error [dufuz]
* Fix Bug #7531: Email-checks need to be more RFC-compliant [amir]
* Fix Bug #7648: VALIDATE_EALPHA does not include the � character [amir]
* Fix Bug #7864: uris rejected if subdomain contains underscores [amir]
* Fix Bug #8442: Undefined variable "return" [amir]
* Fix Bug #8629: eMail validation fails [amir]
* Fix Bug #8768: Valid URL's are marked invalid [amir]
* Fix Bug #8839: defect [amir]
* Fix Bug #8851: date-validation allows letters in time. [amir]
* Fix Bug #8853: E-Mail validation allows space before TLD [amir]
* Fix Bug #9156: Missing characters in validation sequence [amir]
* Fix Bug #9385: Missing characters in validation sequence [amir]
* Fix Bug #9386: Missing punctuation mark (hyphen) in VALIDATE_NAME [amir]
* Fix Bug #10044: email validation bug [davidc]
* Fix Bug #10167: ISSN/ISBN validation is broken by _checkControlNumber [dufuz]
* Fix Bug #10844: Validate::multiple() breaks by consolidating single field array [toggg]
* Fix Bug #11073: date() %d validates \d{1,2} as correct [amir]
* Fix Bug #11592: Email validation not working properly [davidc]
* Fix Bug #12452: EALPHA_LOWER is missing a � [thesaur]
* Implement Feature #11244: documentation [davidc]
* Implement Feature #8073: a@a is valid email [amir]
* Removed dependency on Net_IDNA [davidc] - 0.8.0 (beta, 2007-12-10)
Release notes
License: New BSD
- string():
* New chars in VALIDATE_EALPHA_LOWER and UPPER
- date():
* RFC822 date-time format compliant - 0.7.0 (beta, 2006-11-17)
- 0.6.5 (beta, 2006-10-05)
Release notes
License: New BSD
- __stringToUtf7():
* #8442, Preventing a Notice
- email():
* #8629, hostnames starting with numbers are valid because of their popularity
* #8853, E-Mail validation allows space before TLD.
- date():
* #8851, date-validation allows letters in time. - 0.6.4 (beta, 2006-07-31)
Release notes
License: New BSD
- string():
* #7648, Adding a new character to VALIDATE_EALPHA
- email():
* #8073, a@a is a valid email address just in RFC restricted mode
- email():
* #7531, utf-7 encoding
- __stringToUtf7():
* new method added to do care about utf-7 - 0.6.3 (beta, 2006-04-20)
Release notes
License: New BSD
- email():
* #6930, accepts options as an array to confirm to the Validate standard
previous boolean $check_domain still accepted for backwards compatibility
* #7176, introduces an experimental option "use_rfc822"
which switch to a full RFC822 new checker
* unit test enhanced and completed
- class_exists call in mulitple() now passes false to the autoload param
- uri():
* #6181, Accept URI terminating with a /
* use !empty() instead of isset()
* minus in the top domain as http://example.co-m is invalid
* Double slashes are accepted in the path part (requested by bjori)
As a consequence, only URIs with full authority can be valid, no relative URI
* documentation header completed : usage notes , options and "strict" parameter
* unit tests completed and updated , use php.net instead of unavailable example.org - 0.6.2 (beta, 2005-11-04)
Release notes
License: New BSD
- Change licence to the new BSD License
(see http://www.opensource.org/licenses/bsd-license.php)
- The path part in uri cannot contain two slash characters.
- Refactored email() regexp, hardened hostname check (taken from uri()) (bug #5804)
- Empty quoted email recipient is not valid, must at least contain a non blank char
- Use & as delimiter as �£ is problematic if the script is saved utf8
- Enhanced uri.phpt and email.phpt tests - 0.6.1 (beta, 2005-09-13)
Release notes
License: New BSD
- Bug #5390 XML Package Error
- uri was enchanced to fully comply with RFC2396 (Bertrand) (forgotten in last release changelog) - 0.5.0 (alpha, 2005-05-20)
Release notes
License: New BSD
- Bug #2936, typo
- Bug #2879, Issn wrong validation
- Better email validation
- Request #997 validate:date minium and maximum accept Date objects (By Torsten Roehr)
- Request #4055 Making multiple() cope with new dir structure (By Torsten Roehr)
To use with Validate_Finance_CreditCard then do 'type' => 'Finance_CreditCard_number'
For Validate_US it would be 'type' => 'US_ssn'
This applies to all packages like that under Validate.
- unit testing for multiple (By Torsten Roehr)
- CS fixes
- Split country and finance classes and credit card functions into their own sub packages of Validate
- New lead/developer (Helgi)
- Few more none alpha chars added
- _check_control_number renamed to _checkControlNumber
_get_control_number renamed to _getControlNumber
_mult_weights renamed to _multWeights
- added email test
- Split these functions over to a new sub package called Validate_ISPN (International Standard Product Numbers)
* ISSN
* ISBN
* ISMN
* EAN8
* EAN13
* EAN14
* UCC12
* SSCC
- splited multiple() test in with (skipif not installed) or without card, - 0.4.1 (alpha, 2004-03-16)
Release notes
License: New BSD
- fixed issue when validating IBANs via a static call
- added missing test validate_UK.php to package.xml - 0.4.0 (alpha, 2004-03-16)
Release notes
License: New BSD
- pt_BR moved to ptBR required for multiple support(BC break)
- Add CH validation (Switzerland)
- added Euro banknotes IDs
- Improved UK postcodes validation
- Fixed allowed_scheme options in Validate::uri() (Torsten Roehr)
- Fixed optional arguments in Validate::number() (Torsten Roehr) - 0.3.0 (alpha, 2003-12-16)
Release notes
License: New BSD
- Added Finance Validations for Financial related datas
(S. Neufeind, Piotr Klaban)
- Add polish validation (Piotr Klaban)
- Add German validation (Stefan Neufeind)
- Add EAN-UCC validtatio (see http://www.ean-ucc.org) (Piotr Klaban)
- Add International Standard Serial Number (ISSN)
and Music Number(ISMN) (Piotr Klaban, David Grant)
- Drop Validate::url() in preferenc of Validate::uri() which is fully
RFC2396 compliant
- Move to PHP 3.0 license - 0.2.0 (alpha, 2003-06-15)
Release notes
License: New BSD
- Add some dutch validations
- 0.1.2 (alpha, 2003-05-15)
- 0.1.1 (alpha, 2003-03-12)
Release notes
License: New BSD
- Validate::date(); argument parsing fixed
- 0.1.0 (alpha, 2003-02-18)
- 0.0.4 (alpha, 2003-02-16)
- 0.0.3 (alpha, 2002-08-18)
- 0.0.2 (alpha, 2002-08-18)
Bugs
| ID | Status | Type | Version | Date | Summary |
|---|---|---|---|---|---|
| #357 | Closed | Bug | 2003-12-05 | Revised validate::url method | |
| #901 | Bogus | Bug | 2004-02-26 | PEAR QA: improvement for get_class()-usage | |
| #956 | Closed | Req | 2004-03-06 | Validate::email() doesn't allow Internationalized Domain Names (IDN) | |
| #997 | Closed | Req | 2004-03-11 | validate:date minium and maximum accept Date objects | |
| #1720 | Bogus | Bug | 2004-06-25 | Validate::uri: any alphanumeric string is a valid uri | |
| #1761 | Closed | Req | 2004-07-01 | new Methods in validate_US.php | |
| #1799 | Bogus | Bug | 2004-07-05 | is_numeric not trim strings | |
| #2194 | Closed | Req | 2004-08-22 | Incomplete credit card number validation | |
| #2195 | Bogus | Bug | 2004-08-22 | Validate doesn't work on PHP installation without PCRE functions | |
| #2200 | Closed | Req | 2004-08-23 | Discrepency in method names and additional methods | |
| #2337 | Bogus | Bug | 2004-09-15 | Validate::uri doesn't work | |
| #2578 | Bogus | Bug | 2004-10-20 | Validate:uri() fails on "double protocol" and missing tlds | |
| #2662 | Closed | Bug | 2004-11-01 | Invalid email addresses are validated | |
| #2879 | Closed | Bug | 2004-12-03 | Issn wrong validation | |
| #2936 | Closed | Bug | 2004-12-09 | Typo in sample_multiple.php | |
| #3125 | Closed | Bug | 2005-01-06 | inval() breaks Validation zero-padded SSN | |
| #4055 | Closed | Req | 2005-04-04 | Patch for Validate::multiple() and CreditCard::number() | |
| #4068 | Closed | Bug | 2005-04-05 | errant "return true;" in Validate_US::phoneNumber | |
| #4246 | Bogus | Req | 2005-04-29 | Validate::uri doesn't check url | |
| #4587 | Closed | Bug | 2005-06-14 | The sample_multiple.php file is out of date | |
| #4663 | Wont fix | Req | 2005-06-23 | Return/pass reason for failure to validate | |
| #4845 | Closed | Bug | 2005-07-16 | uri method always returns true | |
| #4991 | Wont fix | Req | 2005-08-03 | Roman numeral validation | |
| #5390 | Closed | Bug | 2005-09-13 | XML Package Error | |
| #5577 | Wont fix | Req | 2005-10-01 | Allow date input as an array | |
| #5582 | Bogus | Bug | 2005-10-02 | second parameter in string should have a default | |
| #5804 | Closed | Bug | 2005-10-28 | "-" is valid in domain extension | |
| #5993 | Bogus | Req | 2005-11-17 | validate persian or Arabic strings in UTF-8 | |
| #6129 | Bogus | Bug | 2005-12-02 | Incorrect time validation | |
| #6130 | Wont fix | Req | 2005-12-02 | Use PEAR::raiseError instead of trigger_error | |
| #6181 | Closed | Bug | 2005-12-07 | Validate::uri marks valid uri as invalid | |
| #6461 | Closed | Bug | 2006-01-11 | Validate::URI doesn't appear to validate URNs correctly. | |
| #6930 | Closed | Bug | 0.6.2 | 2006-02-24 | Email validation via ::multiple always checks domain |
| #7011 | Closed | Req | 0.6.2 | 2006-03-03 | VALIDATE_STREET pattern does not permit '.' |
| #7038 | Closed | Bug | 0.6.2 | 2006-03-06 | names with umlauts accidently declared valid |
| #7176 | Closed | Bug | 0.6.2 | 2006-03-21 | Validate::email doesn't allow some proper RFC 822 addresses |
| #7317 | Bogus | Bug | 2006-04-05 | function_exists('checkdnsrr') allways return false | |
| #7531 | Closed | Bug | 0.6.3 | 2006-05-01 | Email-checks need to be more RFC-compliant |
| #7648 | Closed | Bug | 0.6.3 | 2006-05-17 | VALIDATE_EALPHA does not include the Å character |
| #7864 | Closed | Bug | 0.6.3 | 2006-06-11 | uris rejected if subdomain contains underscores |
| #8073 | Closed | Req | 0.6.3 | 2006-06-29 | a@a is valid email |
| #8166 | Bogus | Bug | 0.6.3 | 2006-07-08 | Validate::uri() fails on URL with trailing / |
| #8442 | Closed | Bug | 0.6.4 | 2006-08-15 | Undefined variable "return" |
| #8629 | Closed | Bug | 0.6.4 | 2006-09-04 | eMail validation fails |
| #8768 | Closed | Bug | 0.6.4 | 2006-09-22 | Valid URL's are marked invalid |
| #8839 | Closed | Bug | CVS | 2006-10-03 | defect |
| #8851 | Closed | Bug | 0.6.4 | 2006-10-04 | date-validation allows letters in time. |
| #8853 | Closed | Bug | 0.6.4 | 2006-10-04 | E-Mail validation allows space before TLD |
| #9156 | Closed | Bug | 0.6.5 | 2006-10-24 | Missing characters in validation sequence |
| #9385 | Closed | Bug | 0.7.0 | 2006-11-19 | Missing characters in validation sequence |
| #9386 | Closed | Bug | 0.7.0 | 2006-11-19 | Missing punctuation mark (hyphen) in VALIDATE_NAME |
| #9985 | Duplicate | Bug | 0.7.0 | 2007-01-31 | Can't validate URI that end with a '/' |
| #10044 | Closed | Bug | CVS | 2007-02-07 | email validation bug |
| #10167 | Closed | Bug | CVS | 2007-02-23 | ISSN/ISBN validation is broken by _checkControlNumber |
| #10844 | Closed | Bug | 0.7.0 | 2007-04-26 | Validate::multiple() breaks by consolidating single field array |
| #11001 | Closed | Bug | 0.7.0 | 2007-05-10 | RFC822 Comments break PCRE |
| #11073 | Closed | Bug | 0.7.0 | 2007-05-18 | date() %d validates \d{1,2} as correct |
| #11203 | Bogus | Bug | 0.7.0 | 2007-06-01 | email with slash are returned as valid by Validate::email |
| #11244 | Closed | Doc | 0.7.0 | 2007-06-06 | documentation |
| #11592 | Closed | Bug | 0.7.0 | 2007-07-12 | Email validation not working properly |
| #12452 | Closed | Bug | 0.7.0 | 2007-11-15 | EALPHA_LOWER is missing a ß |
| #12658 | Closed | Bug | 0.8.0 | 2007-12-11 | New lines at end of file create output |
| #13512 | Bogus | Bug | 0.8.1 | 2008-03-27 | URI with slash / in queryparam is seen as invalid |
| #13825 | Assigned | Bug | 0.8.1 | 2008-05-02 | Email validation not working for '&' |
| #14046 | Closed | Doc | 0.8.1 | 2008-06-02 | Docs desperately needed |
| #14075 | Closed | Bug | 0.8.1 | 2008-06-04 | Validate::uri() rejects valid tag: URIs |
| #14180 | Closed | Doc | 0.8.1 | 2008-06-18 | Typo in $modulo variable description |
| #14214 | Bogus | Bug | 0.8.1 | 2008-06-23 | Validates URL even when query string starts with an ampersand |
| #14377 | Bogus | Req | CVS | 2008-07-21 | Improve PHPCS results |
| #14567 | Wont fix | Req | 0.8.1 | 2008-08-26 | Check string for minimum number of certain character type |
| #14571 | Wont fix | Req | 0.8.1 | 2008-08-26 | Validation with UTF-8 |
| #14791 | Closed | Req | CVS | 2008-10-14 | Improve PHPCS Results |
| #14865 | Closed | Bug | CVS | 2008-10-25 | Unit test failure: email.phpt (Net_IDNA?) |
| #14866 | Closed | Bug | CVS | 2008-10-25 | Notice: Undefined index: VALIDATE_ITLD_EMAILS |
| #14931 | Closed | Bug | CVS | 2008-10-31 | Warning: max(): Array must contain atleast one element |
| #15836 | Wont fix | Req | CVS | 2009-01-30 | Add VALIDATE_ZIP_CODE and VALIDATE_PHONE |
| #15942 | Closed | Bug | 0.8.2 | 2009-02-25 | Problem with PEAR Validate |
| #15945 | Closed | Bug | 0.8.2 | 2009-02-25 | improper string used to check domain dns |
| #16109 | Bogus | Bug | 0.8.2 | 2009-04-16 | email validates with one trailing newline character |
| #16316 | Bogus | Bug | 0.8.2 | 2009-06-10 | URIs with spaces in domain return valid |
| #16381 | Closed | Bug | 0.8.2 | 2009-06-26 | string format validation fails for VALIDATE_NAME.VALIDATE_XXX |
| #16427 | Closed | Bug | 0.8.2 | 2009-07-11 | Email Validation not working for check_domain |
| #16489 | Closed | Req | Unknown | 2009-08-03 | Validate should use mb_strlen |
| #16700 | Bogus | Bug | CVS | 2009-10-14 | Invalid characters allowed in RFC822 validation |
| #16811 | Closed | Bug | 0.8.2 | 2009-11-20 | should determine whether Net/IDNA.php is available less "destructively" |
| #16897 | Open | Bug | 0.8.3 | 2009-12-10 | Validate fractional numbers less than 1 |
| #17043 | Open | Bug | 0.8.3 | 2010-01-29 | openbase_dir and new includePathFileExists method causes warings |
| #17279 | Closed | Bug | SVN | 2010-03-30 | Validate::email() with 'fullTLDValidation' => 'true' always return false. |
| #17302 | Wont fix | Bug | 0.8.3 | 2010-04-09 | Regular expression "Compilation failed: unrecognized character after (? at ..." |
| #17555 | Closed | Bug | 0.8.3 | 2010-07-02 | | or / |
| #17755 | Closed | Bug | SVN | 2010-08-19 | Encoding to UTF-8 in Validate.php |
| #17756 | Closed | Bug | SVN | 2010-08-19 | Avoiding ereg |
| #17947 | Closed | Bug | 0.8.4 | 2010-10-11 | testdate test fails if date.timezone not set |
| #17948 | Closed | Bug | 0.8.4 | 2010-10-11 | multicard test fails |
| #17963 | Closed | Req | 0.8.4 | 2010-10-16 | Allow test suite to run without DNS resolver |
| #17975 | Open | Bug | 0.8.4 | 2010-10-19 | Validate E_STRICT incompatibility |
| #18408 | Closed | Req | SVN | 2011-03-30 | raise min required PHP version to 5.1.0 |
| #19132 | Open | Bug | 0.8.4 | 2011-12-13 | VALIDATE_EALPHA_UPPER/LOWER Turkish accents are wrong |
| #19143 | Bogus | Bug | 0.8.5 | 2011-12-18 | user@yahoo..com reported as a valid email address |
| #19439 | Closed | Doc | 0.8.5 | 2012-05-28 | Package description improvement |
| #19440 | Feedback | Bug | 0.8.5 | 2012-05-28 | Outdated top level domains list |
| #19630 | Open | Bug | 0.8.5 | 2012-10-03 | Validate::string returns true for "max_length"=>0 when it shouldn't. |
| #29034 | Open | Bug | 0.8.6 | 2025-04-18 | Non-static method Validate::_modf() cannot be called statically |