Browse Source

* Fix Illegal string offset for PHP 7.1

Visman 6 years ago
parent
commit
5f5dba3ff7
1 changed files with 3 additions and 0 deletions
  1. 3 0
      app/Core/Validator.php

+ 3 - 0
app/Core/Validator.php

@@ -187,6 +187,9 @@ class Validator
                  $rules[$vs[0]] = isset($vs[1]) ? $vs[1] : '';
             }
             if (isset($suffix)) {
+                if (isset($this->rules[$field]['array']) && ! \is_array($this->rules[$field]['array'])) {
+                    $this->rules[$field]['array'] = [];
+                }
                 $this->rules[$field]['array'][$suffix] = $rules;
             } else {
                 $this->rules[$field] = $rules;