Skip to content

Commit

Permalink
fix: TypeError when there is numeric field name
Browse files Browse the repository at this point in the history
TypeError: str_contains(): Argument #1 ($haystack) must be of type string, int given
  • Loading branch information
kenjis committed Aug 22, 2024
1 parent dbff203 commit 99f41ee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions system/Validation/Validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ public function run(?array $data = null, ?string $group = null, $dbGroup = null)
// Run through each rule. If we have any field set for
// this rule, then we need to run them through!
foreach ($this->rules as $field => $setup) {
// An array key might be int.
$field = (string) $field;

$rules = $setup['rules'];

if (is_string($rules)) {
Expand Down

0 comments on commit 99f41ee

Please sign in to comment.