Skip to content

Commit 74339a0

Browse files
authored
[FIX] match validation bugs
the strlen calculation is the reason that match validation has some issue because in case the new string has the same size it will make all the operation true while it's not the case.
1 parent 72b847c commit 74339a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Validator/StringValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function url()
105105
public function match(string $key_to_match)
106106
{
107107
$this->isStringAndValid($key_to_match);
108-
if (isset($this->data_source[$key_to_match]) && (strlen($this->field_value) != strlen($this->data_source[$key_to_match])) && ($this->field_value != $this->data_source[$key_to_match])) {
108+
if (isset($this->data_source[$key_to_match]) && ($this->field_value != $this->data_source[$key_to_match])) {
109109
$this->messageItem
110110
->type('string.match')
111111
->message("`$this->field_name` should match `$key_to_match`")

0 commit comments

Comments
 (0)