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] URL parse error fix for issue #7169 #7538

Merged
merged 2 commits into from
Jul 26, 2017

Conversation

satyapramodh
Copy link
Contributor

@RocketChat/core

Closes #7169 #7482

The url parse issue happens in sendMessage while the regex match looks for a url pattern. This pattern ignore the ( and ) characters. This has been added in this PR.

To test the regex you can use Regex101.com with the new regex
([A-Za-z]{3,9})://([-;:&=+$,\w]+@{1})?([-A-Za-z0-9.]+)+:?(\d+)?((/[-+=!:~%/.@,()\w]*)???([-+=&!:;%@/.,\w]+)?(?:#([^\s\)]+))?)?

Examples:
https://en.wikipedia.org/wiki/Bear_(disambiguation)
https://cs.wikipedia.org/wiki/Bylina_(pov%C4%9Bst)

Hope this helps!

@CLAassistant
Copy link

CLAassistant commented Jul 21, 2017

CLA assistant check
All committers have signed the CLA.

@sampaiodiego sampaiodiego changed the base branch from master to develop July 24, 2017 19:47
@rodrigok rodrigok added this to the 0.58.0 milestone Jul 26, 2017
@rodrigok rodrigok merged commit 5fade40 into RocketChat:develop Jul 26, 2017
@markusstoll
Copy link

I dont think, the issue is fixed. There are still problems with other characters in URLs.

For example

https://de.wikipedia.org/wiki/Grenzübergang_Wartha/Herleshausen

is reduced to https://de.wikipedia.org/wiki/Grenz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants