valitron icon indicating copy to clipboard operation
valitron copied to clipboard

Non-breaking space

Open emrahamet opened this issue 4 years ago • 1 comments

$v = new Validator(['name' => "\xc2\xa0"]);
$v->rule('required', 'name');


if($v->validate()) {
	echo "Yay! We're all good!";
} else {
	// Errors
	print_r($v->errors());
}

output: Yay! We're all good!

emrahamet avatar Aug 20 '20 23:08 emrahamet

I think this behavior is okay. In this situation, we expect to have a name field in our request body and the value of the name field is not essential for us only the existence of the name field is necessary.

mehdihasanpour avatar Jul 02 '22 12:07 mehdihasanpour