Browse Source

Fix nekot rules

Visman 2 years ago
parent
commit
987b2b4e48
1 changed files with 5 additions and 2 deletions
  1. 5 2
      app/Models/Validators/Nekot.php

+ 5 - 2
app/Models/Validators/Nekot.php

@@ -18,8 +18,11 @@ class Nekot extends RulesValidator
     public function nekot(Validator $v, string $value): string
     public function nekot(Validator $v, string $value): string
     {
     {
         if (
         if (
-            '' == $value
-            || \substr(\preg_replace('%\D+%', '', $v->token), 0, 6) !== $value
+            $v->getStatus('token')
+            && (
+                '' == $value
+                || \substr(\preg_replace('%\D+%', '', $v->token), 0, 6) !== $value
+            )
         ) {
         ) {
             $v->addError('Javascript disabled or bot', FORK_MESS_ERR);
             $v->addError('Javascript disabled or bot', FORK_MESS_ERR);
         }
         }