Explorar el Código

Update PostValidatorTrait for noURL rule

Visman hace 3 años
padre
commit
82e2c9406b
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      app/Models/Pages/PostValidatorTrait.php

+ 3 - 1
app/Models/Pages/PostValidatorTrait.php

@@ -176,6 +176,8 @@ trait PostValidatorTrait
             $ruleHideSmilies = 'absent';
         }
 
+        $ruleMessage = 'required|string:trim|max:' . $this->c->MAX_POST_SIZE . ($executive ? '' : '|noURL') . '|check_message';
+
         $v = $this->c->Validator->reset()
             ->addValidators([
                 'check_subject'  => [$this, 'vCheckSubject'],
@@ -194,7 +196,7 @@ trait PostValidatorTrait
                 'subscribe'    => $ruleSubscribe,
                 'preview'      => 'string',
                 'submit'       => 'string|check_timeout',
-                'message'      => 'required|string:trim|max:' . $this->c->MAX_POST_SIZE . '|check_message',
+                'message'      => $ruleMessage,
             ])->addAliases([
                 'email'        => 'Email',
                 'username'     => 'Username',