Validation Bug?? |
Hi
There seems to be a problem with form validation (Ci4). IS THIS A BUG ???? I have writtem my validation rules to config/validation.php as per the documentation. The problem is two-fold. 1) Assuming the "Rules for File Upload" interrogate the file header the following do not seem to work at all ( max_size, mime_in, ext_in), and, 2) the configured error message configured for the rule is not return when the validation fails. Please see the following: Script PHP Code: $file = $this->request->getFile('image'); //file upload.jpg mime = image/jpg, size = 35475 extension = jpg Validation PHP Code: public $image_upload = [ The above returns {"file":"file does not have a valid mime type.","id":"The id field is required"} 1) There should NOT be errors 2) If there is errors the above should return {"file":"Invalid Image File. Only jpg, jpeg, gif or png allowed","id":"User Not Defined."} Now if I run the following validation (to ensure the validator is configured properly).. PHP Code: $validation_array=array('file'=>$file, 'id'=>'7'); The above returns {"file":"file does not have a valid mime type."} If there is errors the above should return {"file":"Invalid Image File. Only jpg, jpeg, gif or png allowed",} IS THIS A BUG ?????? Many thanks (in advance). |
Messages In This Thread |
Validation Bug?? - by 68thorby68 - 05-15-2020, 03:48 AM
RE: Validation Bug?? - by kick - 05-15-2020, 12:02 PM
|