It seems that detecting lengths on strings will use the strlen() function. This causes issues when detecting multibyte strings, as strlen() count bytes, not characters.
Example:
$v->required('user.first_name')->lengthBetween(2, 5)->alpha();
$result = $v->validate([
'user' => [
'first_name' => 'Björk',
],
]);
will thrown an error on validation, indicating that the length is too long (although bytewise correct, it's doubtful that this would be the expected behaviour)
It seems that detecting lengths on strings will use the
strlen()function. This causes issues when detecting multibyte strings, asstrlen()count bytes, not characters.Example:
will thrown an error on validation, indicating that the length is too long (although bytewise correct, it's doubtful that this would be the expected behaviour)