Skip to content

Commit 283edf1

Browse files
committed
fix: modify the condition of the field that isn't the dot given.
1 parent 3ea0c6a commit 283edf1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

system/Validation/Rules.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,11 @@ public function required_without($str = null, ?string $fields = null, array $dat
301301
// Still here? Then we fail this test if
302302
// any of the fields are not present in $data
303303
foreach ($fields as $field) {
304-
if ((strpos($field, '.') === false) && (! array_key_exists($field, $data))) {
305-
return ! empty($data[$field]);
304+
if ((strpos($field, '.') === false) && (! array_key_exists($field, $data) || empty($data[$field]))) {
305+
return false;
306306
}
307307
if (strpos($field, '.') !== false) {
308-
if ($keyField == null) {
308+
if ($keyField === null) {
309309
throw new InvalidArgumentException('You must supply the parameters: keyField');
310310
}
311311

0 commit comments

Comments
 (0)