From ae1cb236647e9969f0239848b2df785c9c5c2f77 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Wed, 29 Mar 2023 09:27:59 +0200 Subject: [PATCH 1/2] Fixing comparison in Url Filter --- libraries/src/Form/Filter/UrlFilter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/src/Form/Filter/UrlFilter.php b/libraries/src/Form/Filter/UrlFilter.php index 93134180f4fd9..3daf1afc7a957 100644 --- a/libraries/src/Form/Filter/UrlFilter.php +++ b/libraries/src/Form/Filter/UrlFilter.php @@ -62,7 +62,7 @@ public function filter(\SimpleXMLElement $element, $value, $group = null, Regist // we assume that it is an external URL and prepend http:// if ( ((string) $element['type'] === 'url' && !$protocol && !$element['relative']) - || (!(string) $element['type'] === 'url' && !$protocol) + || (!((string) $element['type'] === 'url') && !$protocol) ) { $protocol = 'http'; From d972072d1071e3022c20d4083a7ceff4407c406b Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Wed, 29 Mar 2023 11:01:27 +0200 Subject: [PATCH 2/2] Lets make the code easier... --- libraries/src/Form/Filter/UrlFilter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/src/Form/Filter/UrlFilter.php b/libraries/src/Form/Filter/UrlFilter.php index 3daf1afc7a957..e88884d4e75c6 100644 --- a/libraries/src/Form/Filter/UrlFilter.php +++ b/libraries/src/Form/Filter/UrlFilter.php @@ -62,7 +62,7 @@ public function filter(\SimpleXMLElement $element, $value, $group = null, Regist // we assume that it is an external URL and prepend http:// if ( ((string) $element['type'] === 'url' && !$protocol && !$element['relative']) - || (!((string) $element['type'] === 'url') && !$protocol) + || ((string) $element['type'] !== 'url' && !$protocol) ) { $protocol = 'http';