From 0f83e151515badef292f1f231c561dce47f76b85 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Thu, 3 Oct 2024 10:59:59 +1300 Subject: [PATCH] ENH Use symfony/validation logic (#338) --- 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://'