浏览代码

Update PostFormTrait.php

Visman 2 年之前
父节点
当前提交
8014634a25
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      app/Models/Pages/PostFormTrait.php

+ 2 - 1
app/Models/Pages/PostFormTrait.php

@@ -51,6 +51,7 @@ trait PostFormTrait
             $fieldset['username'] = [
             $fieldset['username'] = [
                 'class'     => ['w1'],
                 'class'     => ['w1'],
                 'type'      => 'text',
                 'type'      => 'text',
+                'minlength' => $this->c->USERNAME['min'],
                 'maxlength' => $this->c->USERNAME['max'],
                 'maxlength' => $this->c->USERNAME['max'],
                 'caption'   => 'Username',
                 'caption'   => 'Username',
                 'required'  => true,
                 'required'  => true,
@@ -64,7 +65,7 @@ trait PostFormTrait
                 'maxlength'      => (string) $this->c->MAX_EMAIL_LENGTH,
                 'maxlength'      => (string) $this->c->MAX_EMAIL_LENGTH,
                 'caption'        => 'Email',
                 'caption'        => 'Email',
                 'required'       => 1 === $this->c->config->b_force_guest_email,
                 'required'       => 1 === $this->c->config->b_force_guest_email,
-                'pattern'        => '.+@.+',
+                'pattern'        => '^.*[^@]@[^@].*$',
                 'value'          => $vars['email'] ?? null,
                 'value'          => $vars['email'] ?? null,
                 'autocapitalize' => 'off',
                 'autocapitalize' => 'off',
             ];
             ];