Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Make URL pattern regexes match localhost and URLs with ports #43997

Merged
merged 2 commits into from
Mar 6, 2024

Conversation

mejo-
Copy link
Member

@mejo- mejo- commented Mar 5, 2024

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.

Checklist

@mejo- mejo- added bug 3. to review Waiting for reviews labels Mar 5, 2024
@mejo- mejo- added this to the Nextcloud 29 milestone Mar 5, 2024
@mejo-
Copy link
Member Author

mejo- commented Mar 5, 2024

/compile

mejo- and others added 2 commits March 6, 2024 09:59
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 <jonas@freesources.org>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@mejo- mejo- enabled auto-merge March 6, 2024 09:20
@juliushaertl juliushaertl added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Mar 6, 2024
@@ -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|$)';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please document an @since with the change and intention
Also on URL_REGEX which is changed indirectly

@nickvergessen
Copy link
Member

Also make sure to document the change, so apps using the regex know it changed

@nickvergessen nickvergessen added the pending documentation This pull request needs an associated documentation update label Mar 6, 2024
@mejo- mejo- merged commit 782f808 into master Mar 6, 2024
160 checks passed
@mejo- mejo- deleted the fix/url_regex branch March 6, 2024 10:29
@blizzz blizzz mentioned this pull request Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug pending documentation This pull request needs an associated documentation update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants