Repository navigation
Conversation
Reject URLs with hostname labels longer than 63 characters or complete hostnames longer than 253 characters in both the URL regexes and optimized candidate scanner.
Keep the published URL regex declarations aligned with the new hostname limits.
Keep invalid hostname candidates unchanged instead of autolinking valid-looking prefixes or suffixes, while preserving valid URL boundary behavior.
Check hostname limits during candidate scanning so invalid long URLs stay plain without triggering expensive URL-regex backtracking.
Resume candidate scanning after punctuation that ends an oversized hostname so a following valid URL is still parsed.
…ths when shouldEscapeText is false
Use the same invalid URL range for bare URLs, protocol URLs, and raw HTML parsing, so invalid URL text stays plain while a separate valid URL still gets autolinked.
Share hostname validation and connected URL-range handling between candidate scanning and regex parsing so malformed URLs with paths or queries stay plain while separate valid URLs remain linkable.
Existing issues found while testingThese issues already existed before the hostname-validation changes and are separate from the regressions and suggestions listed above.
Any text that follows the report mention syntax can receive report mention styling, even when no room with that name exists. Reproduction steps:
Expected behaviour: A room name that does not match an existing report should remain plain text. Actual behaviour: The nonexistent room name is highlighted as a report mention. Platforms: Reproduced on web. report-mention-issue.mov
|
|
@carlosmiceli This PR will be reviewed by @JS00001 and @linhvovan29546 Thanks |
|
@linhvovan29546 can you comment for assignment here? It wont let me assign you |
|
Reviewing... |
|
I still cant assign you to review 😕 , are you able to review even without me requesting it in gh? |
Yes |
|
Problem: When a message contains a URL with an otherwise valid hostname and TLD (e.g. https://example.com), if a user types or pastes that URL directly followed, with no space, by text that makes the combined hostname-class run invalid (e.g. a missed space after a sentence-ending period https://example.com.Thanks! or a doubled punctuation mark https://example.com..nonsense), then Repro: |
I think this is not a bug. Slack (and likely most chat/messaging products) do the same thing |
|
I'll go through the review comments ☝️ on tomorrow noon, thanks. Edit: looking... |
|
This was also the regression (comment), which got fixed in this commit @linhvovan29546 From your comment, I think you meant this: |
|
Update: I'm looking for more regressions in the PR, I'll ping here once I finished finding the regressions and fixing it. Thanks. |
…name continuations
…otocol or URLs after unmatched parentheses
Explanation of Change
ExpensiMark didn't enforce DNS length limits when validating URL hostnames. Because of this, it could treat a hostname with an oversized label as a valid URL even though the hostname violated DNS rules.
This PR adds the two DNS hostname limits used by ExpensiMark:
These limits are applied in both the URL regular expressions and the optimized candidate scanner so that they continue to produce the same result. The scanner now rejects oversized labels and hostnames before passing them to the URL regex, while the regex prevents an invalid hostname or a valid-looking suffix within it from being matched.
Only the hostname is included in these checks. The protocol, port, path, query parameters, fragment, and trailing punctuation remain outside the hostname-length calculation, so URLs with a valid hostname and a long path continue to work normally.
Fixed Issues
$ #102500
PROPOSAL:
Tests
Open the App.
Open any chat.
On Web, open Chrome DevTools and select the Console tab.
Run:
Paste the copied text into the composer and add a space after
.com.Verify that:
Offline tests
Same as Test
QA Steps
Same as Test
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android-native-1.mov
Android-native-2.mov
Android-native-3.mov
Android: mWeb Chrome
Android-mweb-1.mov
Android-mweb-2.mov
Android-mweb-3.mov
iOS: Native
iOS-native-1.mp4
iOS-native-2.mov
iOS-native-3.mov
iOS: mWeb Safari
iOS-safari-1.mov
iOS-safari-2.mov
iOS-safari-3.mov
MacOS: Chrome / Safari
macOS-1.mp4
macOS-2.mp4