mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
fix: if_exist does not work with array data
This commit is contained in:
parent
33477f8d4e
commit
1ca24da3d4
@ -29,6 +29,10 @@ class FormatRules
|
||||
*/
|
||||
public function alpha($str = null): bool
|
||||
{
|
||||
if (is_array($str)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (! is_string($str)) {
|
||||
$str = (string) $str;
|
||||
}
|
||||
|
@ -399,8 +399,10 @@ class Validation implements ValidationInterface
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} elseif (str_contains($field, '.')) {
|
||||
$dataIsExisting = array_key_exists($ifExistField, $flattenedData);
|
||||
} else {
|
||||
$dataIsExisting = array_key_exists($ifExistField, $data);
|
||||
}
|
||||
|
||||
if (! $dataIsExisting) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user