--- /dev/null
+<?php
+namespace wcf\system\form\builder\field;
+use wcf\data\language\Language;
+use wcf\system\form\builder\field\validation\FormFieldValidationError;
+use wcf\util\Url;
+
+/**
+ * Implementation of a form field to enter a url.
+ *
+ * @author Matthias Schmidt
+ * @copyright 2001-2018 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core\System\Form\Builder\Field
+ * @since 3.2
+ */
+class UrlFormField extends TextFormField {
+ /**
+ * @inheritDoc
+ */
+ protected function validateText($text, Language $language = null) {
+ if ($this->isRequired() && ($this->getValue() === null || $this->getValue() === '')) {
+ if (!Url::is($text, FILTER_VALIDATE_URL)) {
+ $this->addValidationError(new FormFieldValidationError(
+ 'invalid',
+ 'wcf.form.field.url.error.invalid',
+ ['language' => $language]
+ ));
+ }
+ else {
+ parent::validateText($text, $language);
+ }
+ }
+ }
+}
<item name="wcf.form.field.userGroupOption.error.nonExistent"><![CDATA[Die folgenden Berechtigungen existieren nicht: {implode from=$options item=option}<code>{$option}</code>{/implode}.]]></item>
<item name="wcf.form.field.username.error.invalid"><![CDATA[Der angegebene Benutzername ist ungültig.]]></item>
<item name="wcf.form.field.username.error.notUnique"><![CDATA[Dieser Benutzername ist bereits vergeben.]]></item>
+ <item name="wcf.form.field.url.error.invalid"><![CDATA[Der angegebene Verweis ist ungültig.]]></item>
</category>
<category name="wcf.imageViewer">
<item name="wcf.imageViewer.button.enlarge"><![CDATA[Vollbild-Modus]]></item>
<item name="wcf.form.field.username.error.invalid"><![CDATA[The entered username is invalid.]]></item>
<item name="wcf.form.field.username.error.notUnique"><![CDATA[The entered username is already in use.]]></item>
<item name="wcf.form.fieldValidator.dotSeparatedString.error.invalidSegments"><![CDATA[The following segments are invalid: {implode from=$invalidSegments key=segmentNumber item=segment}{if $segment !== ''}<code>{$segment}</code>{else}(empty){/if} (segment {#$segmentNumber + 1}){/implode}.]]></item>
+ <item name="wcf.form.field.url.error.invalid"><![CDATA[The entered link is invalid.]]></item>
</category>
<category name="wcf.imageViewer">
<item name="wcf.imageViewer.button.enlarge"><![CDATA[Full Screen Mode]]></item>