瀏覽代碼

Add maxlength for textarea

Visman 2 年之前
父節點
當前提交
fac8a5e9dc
共有 2 個文件被更改,包括 7 次插入4 次删除
  1. 2 0
      app/Models/Pages/Admin/Parser/BBCode.php
  2. 5 4
      app/Models/Pages/Profile/Edit.php

+ 2 - 0
app/Models/Pages/Admin/Parser/BBCode.php

@@ -564,6 +564,7 @@ class BBCode extends Parser
                     'value'     => $structure->handler,
                     'value'     => $structure->handler,
                     'caption'   => 'Handler label',
                     'caption'   => 'Handler label',
                     'help'      => 'Handler info',
                     'help'      => 'Handler info',
+                    'maxlength' => '65535',
                 ],
                 ],
                 'text_handler' => [
                 'text_handler' => [
                     'class'     => ['handler'],
                     'class'     => ['handler'],
@@ -571,6 +572,7 @@ class BBCode extends Parser
                     'value'     => $structure->text_handler,
                     'value'     => $structure->text_handler,
                     'caption'   => 'Text handler label',
                     'caption'   => 'Text handler label',
                     'help'      => 'Text handler info',
                     'help'      => 'Text handler info',
+                    'maxlength' => '65535',
                 ],
                 ],
                 'recursive' => [
                 'recursive' => [
                     'type'    => 'radio',
                     'type'    => 'radio',

+ 5 - 4
app/Models/Pages/Profile/Edit.php

@@ -463,10 +463,11 @@ class Edit extends Profile
         if ($this->rules->useSignature) {
         if ($this->rules->useSignature) {
             $fields = [];
             $fields = [];
             $fields['signature'] = [
             $fields['signature'] = [
-                'type'    => 'textarea',
-                'value'   => $this->curUser->signature,
-                'caption' => 'Signature',
-                'help'    => ['Sig max size', num($this->curUser->g_sig_length), num($this->curUser->g_sig_lines)],
+                'type'      => 'textarea',
+                'value'     => $this->curUser->signature,
+                'caption'   => 'Signature',
+                'help'      => ['Sig max size', num($this->curUser->g_sig_length), num($this->curUser->g_sig_lines)],
+                'maxlength' => $this->curUser->g_sig_length,
             ];
             ];
             $form['sets']['signature'] = [
             $form['sets']['signature'] = [
                 'class'  => ['data-edit'],
                 'class'  => ['data-edit'],