-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Validation rule with *
gets incorrect values as dot array syntax
#8128
Labels
bug
Verified issues on the current code behavior or pull requests that will fix them
Comments
kenjis
added
the
bug
Verified issues on the current code behavior or pull requests that will fix them
label
Oct 30, 2023
5 tasks
There is the bug. CodeIgniter4/system/Validation/Validation.php Lines 170 to 176 in 0872a21
This code came from: d6a2327f and 7dce1aa7d58 |
if (strpos($field, '*') !== false) {
$flatten = array_flatten_with_dots($data);
$pattern ='/^'
. str_replace(['\.\*', '\*\.'], ['\..+', '.+\.'], preg_quote($field, '/'))
. '$/';
$values = array_filter($flatten, static fn ($key) => preg_match(
$pattern,
$key
), ARRAY_FILTER_USE_KEY);
// if keys not found
$values = $values ?: [$field => null];
} else {
|
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From #8079 (comment)
The
name
key iscontacts.just.friends.*.name
, notcontacts.*.name
.The text was updated successfully, but these errors were encountered: