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
#3
@karsen I've looked into your code.

required_if - in my view you can just make required work properly (line 47 in my paste) instead of adding whole new rule.

valid_datetime - it's a shame that you haven't tested it because the formats are different and it's returning error every time. Inspired I've implemented my version of this.

>there is no foolproof way to ensure it’s actually an image, but is will weed out most bad images

PHP manual advises against using getimagesize for validation.

I apply finfo, imagecreatefromjpeg (not in validation class but in a separate function because I handle images after validation) and htaccess.

From what I understand @firestorm uses finfo, getimagesize and optionally imagecreate.

in_array - similar to in but you utilize array keys and I use sub-arrays. By the way, you can create unordered list in a single line:

Code:
$allowed = (empty($rule_value) ? "" : "<ul><li>") . implode("</li><li>", $rule_value) . (empty($rule_value) ? "" : "</li></ul>");


  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: 6 Guest(s)