From 0cb72e09d05fb20a416c677dde6e6cfc7fb3e2d5 Mon Sep 17 00:00:00 2001 From: ping-yee <611077101@mail.nknu.edu.tw> Date: Mon, 26 Sep 2022 18:08:31 +0800 Subject: [PATCH] cs-fix --- system/Validation/Rules.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/system/Validation/Rules.php b/system/Validation/Rules.php index b3bb9040ebb1..f702b8faba21 100644 --- a/system/Validation/Rules.php +++ b/system/Validation/Rules.php @@ -296,6 +296,8 @@ public function required_without($str = null, ?string $fields = null, array $dat return true; } + $nowKeyField = 0; + if (strpos($keyField, '.') !== false) { $keyFieldArray = explode('.', $keyField); $nowKeyField = $keyFieldArray[1]; @@ -315,7 +317,7 @@ public function required_without($str = null, ?string $fields = null, array $dat $nowField = str_replace('*', $nowKeyField, $field); $nowFieldVaule = dot_array_search($nowField, $data); - return (bool) (null !== $nowFieldVaule); + return null !== $nowFieldVaule; } }