Skip to content

Commit 99f41ee

Browse files
committed
fix: TypeError when there is numeric field name
TypeError: str_contains(): Argument #1 ($haystack) must be of type string, int given
1 parent dbff203 commit 99f41ee

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

system/Validation/Validation.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ public function run(?array $data = null, ?string $group = null, $dbGroup = null)
163163
// Run through each rule. If we have any field set for
164164
// this rule, then we need to run them through!
165165
foreach ($this->rules as $field => $setup) {
166+
// An array key might be int.
167+
$field = (string) $field;
168+
166169
$rules = $setup['rules'];
167170

168171
if (is_string($rules)) {

0 commit comments

Comments
 (0)