Home > Download >  Library download > Data validation library

  • <?php namespace Cake\Validation; use ReflectionClass; class RulesProvider {     /**      * The class/object to proxy.      *      * @var mixed      */     protected $_class;     /**      * The proxied class' reflection      *      * @var \ReflectionClass      */     protected $_reflection;     /**      * Constructor, sets the default class to use for calling methods      *      * @param string $class the default class to proxy      */     public function __construct($class = '\Cake\Validation\Validation')     {         $this->_class = $class;         $this->_reflection = new ReflectionClass($class);     }We know that in the process of using the language, we will definitely pay attention to the security issues in the actual development process. So, today we will introduce to you the verification class library, the primary measure to ensure PHP security. Data verification is the most important habit you may adopt. And when it comes to input, it's very simple: don't trust the user. When validating data to secure PHP, remember that it's often easier to design and validate the values ​​your application allows than to protect against all unknown values.

    Data validation library45612017-12-22
  • <?php namespace Illuminate\Validation; use Illuminate\Contracts\Validation\Rule as RuleContract; class ClosureValidationRule implements RuleContract {     public $callback;     public $failed = false;     public $message;     /**      * Create a new Closure based validation rule.      *      * @param  \Closure  $callback      * @return void      */     public function __construct($callback)     {         $this->callback = $callback;     }We know that in the process of using the language, we will definitely pay attention to the security issues in the actual development process. You need to go to our class library to verify data. Validation of data is the most important habit you can adopt. And when it comes to input, it's very simple: don't trust the user. When validating data to secure PHP, remember that it's often easier to design and validate the values ​​your application allows than to protect against all unknown values.

    Data validation library45372017-12-22
  • <?php class FileInfoTest extends PHPUnit_Framework_TestCase {     protected $fileWithExtension;     protected $fileWithoutExtension;     public function setUp()     {         $this->fileWithExtension = new \Upload\FileInfo(dirname(__FILE__) . '/assets/foo.txt', 'foo.txt');         $this->fileWithoutExtension = new \Upload\FileInfo(dirname(__FILE__) . '/assets/foo_wo_ext', 'foo_wo_ext');     }     public function testConstructor()     {         $this->assertAttributeEquals('foo', 'name', $this->fileWithExtension);         $this->assertAttributeEquals('txt', 'extension', $this->fileWithExtension);         $this->assertAttributeEquals('foo_wo_ext', 'name', $this->fileWithoutExtension);         $this->assertAttributeEquals('', 'extension', $this->fileWithoutExtension);     }We know that in the process of using the language, we will definitely pay attention to the security issues in the actual development process. So, today we will introduce to you the primary measure to ensure PHP security-verification data. Validation of data is the most important habit you can adopt. And when it comes to input, it's very simple: don't trust the user. When validating data to secure PHP, remember that it's often easier to design and validate the values ​​your application allows than to protect against all unknown values. General validation tips that apply to various types of validation data are listed below: 1. Use values ​​from the whitelist2. Always re-validate limited options3. Use the built-in escape function4. Verify that the correct data type (such as a number)The value in the white-listed value (White-listed value) is the correct value , as opposed to an invalid blacklist value (Black-listed value). The difference between the two is that typically when validating data, the list or range of possible values ​​is smaller than the list or range of invalid values, many of which may be unknown or unexpected values.

    Data validation library38922017-12-22
  • PHP common form regular validation class

    Data validation library44752017-11-20
  • php verification class

    Data validation library38262017-11-13
  • Recommended data validation classes in PHP

    Data validation library37512017-11-03
  • Mainly introduces the usage of common PHP form validation classes, and analyzes common PHP validation techniques for form elements with examples. Restore special characters from the data library. The incoming value can be a string or a one/two-dimensional array. The data format for data display restoration is mainly used for content output. The incoming value can be a string or a one/two-dimensional array. One/two-dimensional array.

    Data validation library48402017-06-06
  • Introducing a TP3.2 simple data verification php class, is used to handle the verification of Model entry data. Many times, when we process data in the Model, we will pass in many parameters at once. At this time, we may need to judge the parameters, whether there are fewer parameters, and whether the format of the parameters is correct. If it is correct every time, It will be very troublesome to judge a lot of ifs. I have used CI before, which has a class to verify the data submitted by the form, and then I wrote this method according to my habit.

    Data validation library42532017-06-06
  • Share a PHP verification class, check whether the input is a number, check whether the input is a phone number, check whether the input is a mobile phone number, check whether the input is a zip code, check the validity of the email address, check the validity of the name and nickname, only Enter Chinese and English to check whether an (English) domain name is legal.

    Data validation library42272017-06-06
  • Share an extensible and fully functional PHP verification class, Various verifications that can be performed in the class can be adjusted and implemented by themselves. This is the basic implementation method. If you need to add a rule, define the method directly, and the method name is the rule name. Please refer to the usage method for details.

    Data validation library45852017-06-06
  • Share a good php verification class. Number verification, Name matching, such as user name, directory name, etc., Whether Chinese is supported, it is supported by default. If it matches the file name, it is recommended to turn this off (false), Email verification, Mobile phone number Verification, URL verification, pure URL format, does not support IP verification. #

    Data validation library41962017-06-06
  • Introducing a php data checking class commonly used in PHP development for friends to learn and refer to. Some judgments are added, such as: is IPv4, is it is the email address, whether is a URL, whether is a positive integer, whether is within the range, and whether is a valid length.

    Data validation library40022017-03-30