07-10-2017, 07:29 PM
Thought I'd share my own validation additions: https://pastebin.com/VSpRmJm6
Here's what I added:
Date/Time checks-
valid_date- checks if a date is in a valid format
valid_month- checks if a month date is in a valid format
valid_time- checks if a time is in a valid format
valid_datetime- checks if a full datetime is in a valid format
valid_futuredate- checks to see if a date is in the future
Image checks-
valid_image- checks if an image is of a valid type (there is no foolproof way to ensure it's actually an image, but is will weed out most bad images)
unique_image- checks if an image name already exists
image_width- checks if an image is wide enough
image_height- checks if an image is high enough
Misc. checks-
valid_tracking- validates a tracking number using the Argo class package (https://github.com/dsposito/argo)
in_array- checks if a value is a valid match from a given array
zxcvbn- rates a password strength based on the Zxcvbn class package (https://github.com/bjeavons/zxcvbn-php). I use this in conjunction with the Javascript version for before/after form submission checks
Here's what I added:
Date/Time checks-
valid_date- checks if a date is in a valid format
valid_month- checks if a month date is in a valid format
valid_time- checks if a time is in a valid format
valid_datetime- checks if a full datetime is in a valid format
valid_futuredate- checks to see if a date is in the future
Image checks-
valid_image- checks if an image is of a valid type (there is no foolproof way to ensure it's actually an image, but is will weed out most bad images)
unique_image- checks if an image name already exists
image_width- checks if an image is wide enough
image_height- checks if an image is high enough
Misc. checks-
valid_tracking- validates a tracking number using the Argo class package (https://github.com/dsposito/argo)
in_array- checks if a value is a valid match from a given array
zxcvbn- rates a password strength based on the Zxcvbn class package (https://github.com/bjeavons/zxcvbn-php). I use this in conjunction with the Javascript version for before/after form submission checks