From a08a88b97d69e7760d709170c882f16f14d54ab0 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Thu, 27 Apr 2023 13:32:10 +0200 Subject: [PATCH] Change URL form field to `input type="url"` Closes #5266 --- com.woltlab.wcf/templates/__textFormField.tpl | 2 +- wcfsetup/install/files/acp/templates/__textFormField.tpl | 2 +- .../system/form/builder/field/TextFormField.class.php | 9 +++++++++ .../lib/system/form/builder/field/UrlFormField.class.php | 8 ++++++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/com.woltlab.wcf/templates/__textFormField.tpl b/com.woltlab.wcf/templates/__textFormField.tpl index edf7555379..dfcfde60bd 100644 --- a/com.woltlab.wcf/templates/__textFormField.tpl +++ b/com.woltlab.wcf/templates/__textFormField.tpl @@ -1,4 +1,4 @@ -validateMinimumLength($text, $language); $this->validateMaximumLength($text, $language); } + + /** + * Returns the value for the `type` attribute of the input field. + * @since 6.0 + */ + public function getInputType(): string + { + return 'text'; + } } diff --git a/wcfsetup/install/files/lib/system/form/builder/field/UrlFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/UrlFormField.class.php index 288e11b710..ade83d4295 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/UrlFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/UrlFormField.class.php @@ -56,4 +56,12 @@ class UrlFormField extends TextFormField } } } + + /** + * @inheritDoc + */ + public function getInputType(): string + { + return 'url'; + } } -- 2.20.1