-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Chat- Invalid URL can be parsed by adding https:// to the URL in title #23476
Comments
Triggered auto assignment to @sophiepintoraetz ( |
Bug0 Triage Checklist (Main S/O)
|
I might be wrong, but from what i see the parsing happens in the backend |
I'm unable to reproduce what is shown in the video. |
I am able to reproduce on latest main using Expected Result:Invalid URLs containing incorrectly placed hyphens (such as Actual Result:Invalid URLs are initially converted to links as long as they start with a protocol (e.g. https://), before BE strips the link from the anchor tag, leaving a blank link that on click opens NewDot instead. |
ProposalPlease re-state the problem that we are trying to solve in this issue.URLs with protocol added (e.g. What is the root cause of that problem?This was introduced by this PR which added a "loose" regex for matching localhost-style URLs (which it applies to any URL which has a protocol (e.g.
The
This results in invalid URLs being briefly shown as links by FE (as if they are valid), before the BE strips the URL from the link (as it is invalid). What changes do you think we should make in order to solve the problem?I think we want to keep the loose regex to support localhost-style URLs, but tighten it back up so that it still blocks leading (and ending) hyphens. This is easy to do by just reusing the domain part of
This passes all existing tests here, as well as the following additional tests:
|
@lanitochka17 - can you please clean up the reproduction steps and confirm whether @jjcoffee's steps are clearer expected results? |
All right, closing this until we hear from @lanitochka17. |
@sophiepintoraetz Be sure to fill out the Contact List! |
Looks like this will be handled in #23535 |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
If name + incorrect format URL or If URL in incorrect format, it should not be hyperlinked and must not be directed to expensify site
If name + URL started with hyphen or if URL is started with hyphen, excluding the hyphen, all text must be hyperlinked
Actual Result:
If (https://
)URL in incorrect format, it should not be hyperlinked but it is directed to expensify site
If (https://
)URL is started with hyphen, excluding the hyphen, all text must be hyperlinked. But here, entire text with hyphen shown as hyperlink and directed to expensify site
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.44.0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Bug6138610_chill.mp4
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: