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(message-parser): Phone pattern #900

Merged
merged 3 commits into from
Nov 14, 2022
Merged

fix(message-parser): Phone pattern #900

merged 3 commits into from
Nov 14, 2022

Conversation

hugocostadev
Copy link
Contributor

@hugocostadev hugocostadev commented Nov 11, 2022

Proposed changes (including videos or screenshots)

The Phone code matches any plus sign (+) followed by one or more digits, regardless of whether it is a valid phone number.
To fix this behavior we are now checking if the phone number has any other characters other than (, ) and - and at least 5 numbers

Steps to reproduce:

In a chat, enter the text 1+1=2

Expected behavior:

The chat message should not contain any hyperlinks

other e.g:
image

Actual behavior:

The +1 is hyperlinked to tel:1 even though it is not a valid phone number.

Other e.g:
image

Issue(s)

RocketChat/Rocket.Chat#27141

Further comments

TC-250

@gabriellsh gabriellsh merged commit 6062700 into develop Nov 14, 2022
@gabriellsh gabriellsh deleted the fix/phone branch November 14, 2022 13:19
@ggazzo
Copy link
Member

ggazzo commented Nov 14, 2022

@Mergifyio backport v0.31.22

@mergify
Copy link

mergify bot commented Nov 14, 2022

backport v0.31.22

❌ No backport have been created

  • Backport to branch v0.31.22 failed: Branch not found

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.

3 participants