From 02694411a8baf34053bbce4b120b2ee0bfe09d7c Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 5 Mar 2024 12:10:22 +0100 Subject: fix: Make URL pattern regexes match localhost and URLs with ports E.g. the file reference widget should work with links to Nextcloud on localhost. This adjusts the URL pattern regexes in server to be in sync with the ones in `@nextcloud/vue`. See nextcloud-libraries/nextcloud-vue#5176 for further details. Signed-off-by: Jonas --- lib/public/IURLGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/public/IURLGenerator.php b/lib/public/IURLGenerator.php index f62503f14ec..0c7dc070778 100644 --- a/lib/public/IURLGenerator.php +++ b/lib/public/IURLGenerator.php @@ -51,7 +51,7 @@ interface IURLGenerator { * * @since 25.0.0 */ - public const URL_REGEX_NO_MODIFIERS = '(\s|\n|^)(https?:\/\/)((?:[-A-Z0-9+_]+\.)+[-A-Z]+(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|\n|$)'; + public const URL_REGEX_NO_MODIFIERS = '(\s|\n|^)(https?:\/\/)([-A-Z0-9+_.]+(?::[0-9]+)?(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|\n|$)'; /** * Returns the URL for a route -- cgit v1.2.3