Skip to content

Commit 7b405d1

Browse files
committed
fix: add type check
1 parent 5722ab0 commit 7b405d1

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

system/Validation/StrictRules/Rules.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ public function greater_than_equal_to($str, string $min): bool
117117
*/
118118
public function is_not_unique($str, string $field, array $data): bool
119119
{
120+
if (is_object($str) || is_array($str)) {
121+
return false;
122+
}
123+
120124
// Grab any data for exclusion of a single row.
121125
[$field, $whereField, $whereValue] = array_pad(
122126
explode(',', $field),
@@ -171,6 +175,10 @@ public function in_list($value, string $list): bool
171175
*/
172176
public function is_unique($str, string $field, array $data): bool
173177
{
178+
if (is_object($str) || is_array($str)) {
179+
return false;
180+
}
181+
174182
[$field, $ignoreField, $ignoreValue] = array_pad(
175183
explode(',', $field),
176184
3,

0 commit comments

Comments
 (0)