The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Validation Class Improvements
#2
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
  Reply


Messages In This Thread
Validation Class Improvements - by faguss - 06-20-2017, 01:18 PM
Validation Class Improvements - by karsen - 07-10-2017, 07:29 PM
Validation Class Improvements - by faguss - 07-13-2017, 09:48 PM
Validation Class Improvements - by karsen - 07-15-2017, 03:33 PM
Validation Class Improvements - by faguss - 07-15-2017, 03:41 PM
Validation Class Improvements - by karsen - 07-15-2017, 04:31 PM
Validation Class Improvements - by mudmin - 08-25-2017, 12:42 PM
Validation Class Improvements - by eeverts - 11-18-2017, 07:32 PM
Validation Class Improvements - by eeverts - 11-18-2017, 07:41 PM
Validation Class Improvements - by mudmin - 11-19-2017, 11:53 PM
Validation Class Improvements - by eeverts - 11-20-2017, 07:25 AM
Validation Class Improvements - by mudmin - 11-20-2017, 04:06 PM

Forum Jump:


Users browsing this thread: 4 Guest(s)