Use fixed maximum length for email form field
authorMatthias Schmidt <gravatronics@live.com>
Sun, 25 Aug 2019 13:37:21 +0000 (15:37 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 25 Aug 2019 13:37:21 +0000 (15:37 +0200)
See 1be4eb3a5779c73f5e34b57775fbba19faccff10

com.woltlab.wcf/templates/__emailFormField.tpl
wcfsetup/install/files/acp/templates/__emailFormField.tpl
wcfsetup/install/files/lib/system/form/builder/field/EmailFormField.class.php

index 8b22d9b50f8b567512a913abb1092140d87c2dd4..7f62e54a92d2ddb33707a94c1c53f2bba3c32a06 100644 (file)
@@ -4,11 +4,11 @@
        *}id="{@$field->getPrefixedId()}" {*
        *}name="{@$field->getPrefixedId()}" {*
        *}value="{if !$field->isI18n() || !$field->hasI18nValues()}{$field->getValue()}{/if}" {*
-       *}class="long"{*
+       *}class="long" {*
+       *}maxlength="191"{*
        *}{if $field->isAutofocused()} autofocus{/if}{*
        *}{if $field->isRequired()} required{/if}{*
        *}{if $field->isImmutable()} disabled{/if}{*
-       *}{if $field->getMaximumLength() !== null} maxlength="{$field->getMaximumLength()}"{/if}{*
        *}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{*
        *}{if $field->getDocument()->isAjax()} data-dialog-submit-on-enter="true"{/if}{*
 *}>
index 8b22d9b50f8b567512a913abb1092140d87c2dd4..7f62e54a92d2ddb33707a94c1c53f2bba3c32a06 100644 (file)
@@ -4,11 +4,11 @@
        *}id="{@$field->getPrefixedId()}" {*
        *}name="{@$field->getPrefixedId()}" {*
        *}value="{if !$field->isI18n() || !$field->hasI18nValues()}{$field->getValue()}{/if}" {*
-       *}class="long"{*
+       *}class="long" {*
+       *}maxlength="191"{*
        *}{if $field->isAutofocused()} autofocus{/if}{*
        *}{if $field->isRequired()} required{/if}{*
        *}{if $field->isImmutable()} disabled{/if}{*
-       *}{if $field->getMaximumLength() !== null} maxlength="{$field->getMaximumLength()}"{/if}{*
        *}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{*
        *}{if $field->getDocument()->isAjax()} data-dialog-submit-on-enter="true"{/if}{*
 *}>
index 204ee60ea2263ece3a8f6be32ad0c1ca7029e43d..23ae6506a1cc72a938646ae2ee8cfbe55c6a435d 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 namespace wcf\system\form\builder\field;
 use wcf\data\language\Language;
-use wcf\system\exception\UserInputException;
 use wcf\system\form\builder\field\validation\FormFieldValidationError;
 use wcf\system\language\LanguageFactory;
 use wcf\util\UserUtil;
@@ -17,13 +16,12 @@ use wcf\util\UserUtil;
  * @package    WoltLabSuite\Core\System\Form\Builder\Field
  * @since      5.2
  */
-class EmailFormField extends AbstractFormField implements IAutoFocusFormField, II18nFormField, IImmutableFormField, IMaximumLengthFormField, IPlaceholderFormField {
+class EmailFormField extends AbstractFormField implements IAutoFocusFormField, II18nFormField, IImmutableFormField, IPlaceholderFormField {
        use TAutoFocusFormField;
        use TImmutableFormField;
        use TI18nFormField {
                validate as protected i18nValidate;
        }
-       use TMaximumLengthFormField;
        use TPlaceholderFormField;
        
        /**
@@ -92,12 +90,5 @@ class EmailFormField extends AbstractFormField implements IAutoFocusFormField, I
                                ['language' => $language]
                        ));
                }
-               else {
-                       $this->validateMaximumLength(
-                               $email,
-                               $language,
-                               'wcf.form.field.email.error.maximumLength'
-                       );
-               }
        }
 }