62 Commits

Author SHA1 Message Date
USAMI Kenta
28254e76c2 Add type check for stringLength
Return 0 if $value is not string
2015-11-20 16:55:56 +09:00
Alexandros Diamantidis
919005c0f8 Fix validateUrlActive() to check host part of URL for correct DNS records
validateUrlActive() calls checkdnsrr() which by default looks only for MX records, and passes the whole tail part of the URL after the prefix. It should isolate the host and check for A, AAAA or CNAME DNS records.
2015-09-17 13:32:20 +03:00
Vance Lucas
c7342e025a Fix #115 strict flag for in_array 2014-11-20 09:24:40 -06:00
cguroo
eb12058860 Update Validator.php
Hi, I have added a strict flag as an argument since anyone who wishes a strict comparison shall have the option, and btw in_array without strict is sort of "useless" in most cases, IMHO.

heres why i say so.
http://php.net/manual/en/function.in-array.php#106319
2014-11-19 12:09:20 +05:30
Lane Roberts
f8f1c0061b Fix 'Illegal offset type in isset or empty' warning when a param is an object.
Params can be any data type, but keys can only be integers or strings.
2014-09-18 11:08:28 -05:00
Mark Cahill
eace42656a Validate an array of discrete values 2014-09-08 12:34:46 -04:00
Vance Lucas
6d78b00334 PSR-2 formatting and small updates 2014-09-08 11:10:41 -05:00
Mark Cahill
c197b10891 Validation of nested arrays, closes #8 2014-09-08 10:40:53 -04:00
ecoreng
bd09c30efc refactor to avoid foreach when filtering 2014-07-31 22:55:20 -07:00
Vance Lucas
6d36b12f76 Merge pull request #85 from Typeform/master
Add instanceOf to rules in readme.md
2014-07-29 13:00:00 -05:00
Victor Bjelkholm
9d90b08813 Show instance name in instanceOf error message 2014-07-29 16:39:14 +02:00
Justin Hook
9b5b0cff77 Fixes #64. Updated validateDateFormat to use warning_count for validation check 2014-07-26 15:47:50 +01:00
Victor Bjelkholm
8aa6ad1c5d Allow date to be DateTime object 2014-07-14 14:02:34 +02:00
Victor Bjelkholm
ad0f6b9708 Add instanceOf validation 2014-07-14 12:43:00 +02:00
Vance Lucas
f52df87b56 Made the BC Math extension optional 2014-07-07 09:00:28 -05:00
Rayne
40f4e5b34b Typo in Validator 2014-06-10 20:25:58 +02:00
Vance Lucas
ad89c5ec35 Merge pull request #72 from thinkjson/validate-zero
Run validation is field is non-null instead of truthy. Fixes #70
2014-05-27 14:51:00 -05:00
Mark Cahill
272fe84b15 Run validation is field is non-null instead of truthy. Fixes #70 2014-05-27 15:31:13 -04:00
Vance Lucas
2d111d9204 Merge pull request #67 from brandonlamb/features/phpdoc
Update docblocks, consistency/missing types, etc
2014-05-27 14:04:08 -05:00
Brandon Lamb
6454f648a5 Apply some PSR formatting updates 2014-05-26 13:55:30 -07:00
Brandon Lamb
37563d76ba Add missing throws phpdoc 2014-05-26 13:39:03 -07:00
Brandon Lamb
57f2476642 Update docblocks, consistency/missing types, etc 2014-05-26 13:37:13 -07:00
Vance Lucas
430a8324ec Merge pull request #53 from Kilte/feature-length
Add min/max-length validators
2014-04-10 10:53:37 -05:00
Justin Hook
631a5e2138 Updated min and max rules to use bccomp for number comparison. 2014-04-02 21:58:30 +01:00
Justin Hook
4fb6f478ef Fixed issue with Min/Max rules using decimals 2014-04-01 21:17:00 +01:00
Kilte
8871f81476 Add min/max-length validators 2014-01-25 21:18:42 +04:00
Vance Lucas
e011ab81c4 Merge pull request #25 from neves/fix-addRule
Fix add rule
2014-01-11 19:48:40 -08:00
Andrew Willis
f26a1f55b4 fixed indentation and php5.3 array syntax 2014-01-10 06:54:10 +00:00
Andrew Willis
322df8b021 added docblock and readme docs for using the new filter 2014-01-09 22:18:29 +00:00
Andrew Willis
2d0790b984 Added credit card validation for Visa, Mastercard, American Express, Dinersclub and Discover 2014-01-09 22:05:23 +00:00
Kilte
5a10a4fe96 Fixed hasRule() method. 2014-01-07 04:34:38 +04:00
Kilte
db6d49baf6 Fix #33 Validation for length - Message is incorrect for between cases 2014-01-07 00:08:09 +04:00
César Rodríguez
cf791cdf9f fixed documentation + typo 2013-11-28 15:45:55 +01:00
Vance Lucas
add2cc92d2 Merge pull request #31 from biggingernerd/master
Added validator for boolean
2013-11-11 13:05:13 -08:00
Vance Lucas
d51f4c0fa5 Always use custom label in place of field name
Fixes: https://github.com/vlucas/valitron/issues/32
2013-11-11 15:02:19 -06:00
Martijn van Maasakkers
66d62dd96d Removed silly string = true check 2013-10-15 21:21:30 +02:00
Big Ginger Nerd
89352fcc15 Added validator for boolean 2013-10-15 14:59:34 +02:00
Vance Lucas
5dc7fd9fb3 Add support for associative arrays using 'in' 2013-08-30 10:31:57 -05:00
Marcos Neves
cf12d976a6 fix addRule by merging the loaded language with the current messages 2013-08-20 22:03:17 -03:00
Marcos Neves
f793bb7555 missing language file now raises InvalidArgumentException 2013-08-19 12:31:11 -03:00
Marcos Neves
367ec9a7c7 fix bug moving message loading to constructor and replace require with include to avoid fatal error 2013-08-19 10:58:10 -03:00
Marcos Neves
e23ebf6277 fix lang and langDir to have default values 2013-08-16 23:05:24 -03:00
Marcos Neves
2dd9fa79a3 add global static lang support and sample to README.md 2013-08-16 12:20:25 -03:00
Vance Lucas
f0aa5011b6 Add tests for custom labels & fix #20
Ticket: https://github.com/vlucas/valitron/issues/20
2013-08-09 11:42:55 -05:00
Diego Sala
884076b6f7 Fix for issue #17 2013-07-16 15:49:34 -03:00
Thorpe J.Y. Obazee
e0881bdb2a Just a typo 2013-07-10 04:21:33 +08:00
Vance Lucas
05c1b9ab15 Error messages now include field name by default
* Version 1.1.0 release
2013-06-29 10:26:03 -05:00
Tom Graham
81978ef8c7 Added support for non-mandatory fields. Fixes issue #13. 2013-06-19 21:27:56 +01:00
Andrew Smith
4a14b0e13e Added in field labels to allow user to label fields with a different name than the actual label defined in the html. 2013-05-13 13:16:22 +01:00
Pascal Borreli
0ada9f2ad6 Fixed typos 2013-03-06 01:54:59 +00:00