From 46c1d0a5dbf52580e23711b4ecb2c63edd39dd3f Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Tue, 24 Sep 2024 17:38:35 +1200 Subject: [PATCH] ENH Use symfony/validation logic --- src/Models/ExternalLink.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Models/ExternalLink.php b/src/Models/ExternalLink.php index 3ff49ddc..306519e2 100644 --- a/src/Models/ExternalLink.php +++ b/src/Models/ExternalLink.php @@ -28,6 +28,7 @@ public function getCMSFields(): FieldList { $this->beforeUpdateCMSFields(function (FieldList $fields) { $field = UrlField::create('ExternalUrl', _t(__CLASS__ . '.EXTERNAL_URL_FIELD', 'External URL')); + $field->setAllowedProtocols(['http', 'https']); $field->setDescription(_t( __CLASS__ . '.EXTERNAL_URL_FIELD_DESCRIPTION', 'The URL must start with either http:// or https://'