From cec0a107a33bbe9642efa30a59beee987865ea5a Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 4 Apr 2018 10:59:34 +0200 Subject: [PATCH] NavigationItemForm: Fix that urls with partial port macros are not saved refs #3301 --- application/forms/Navigation/NavigationItemForm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/forms/Navigation/NavigationItemForm.php b/application/forms/Navigation/NavigationItemForm.php index 721d5e37d..6cf15e77c 100644 --- a/application/forms/Navigation/NavigationItemForm.php +++ b/application/forms/Navigation/NavigationItemForm.php @@ -100,7 +100,7 @@ class NavigationItemForm extends Form // The regex here specifically matches the port-macro as it's the only one preventing Url::fromPath() from // successfully parsing the given url. Any other macro such as for the scheme or host simply gets identified // as path which is just fine in this case. - if (isset($values['url']) && $values['url'] && !preg_match('~://.+:(\$.+\$)~', $values['url'])) { + if (isset($values['url']) && $values['url'] && !preg_match('~://.+:\d*?(\$.+\$)~', $values['url'])) { $url = Url::fromPath($values['url']); if ($url->getBasePath() === $this->getRequest()->getBasePath()) { $values['url'] = $url->getRelativeUrl();