Commit f7d93277 authored by Ad Schellevis's avatar Ad Schellevis

(mvc) fix for crash report PHP Catchable fatal error: Argument 2 passed to...

(mvc) fix for crash report PHP Catchable fatal error:  Argument 2 passed to Phalcon\Validation::add() must implement interface Phalcon\Validation\ValidatorInterface, array given, called in /usr/local/opnsense/mvc/app/controllers/OPNsense/IDS/Api/ServiceController.php on line 135 and defined in /usr/local/opnsense/mvc/app/models/OPNsense/Base/BaseModel.php
parent 31cb56c2
...@@ -70,7 +70,7 @@ class TextField extends BaseField ...@@ -70,7 +70,7 @@ class TextField extends BaseField
if ($this->internalIsRequired && empty($this->internalValue)) { if ($this->internalIsRequired && empty($this->internalValue)) {
$validators[] = new PresenceOf(array('message' => $msg)) ; $validators[] = new PresenceOf(array('message' => $msg)) ;
} elseif ($this->internalValue != null && $this->internalMask != null) { } elseif ($this->internalValue != null && $this->internalMask != null) {
$validators[] = array(new Regex(array('message' => $msg,'pattern'=>trim($this->internalMask)))); $validators[] = new Regex(array('message' => $msg,'pattern'=>trim($this->internalMask)));
} }
return $validators; return $validators;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment