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: ensure urls with different origins are not rendered as local react-router-dom Links #28

Merged
merged 6 commits into from
Jun 26, 2020

Conversation

majew7
Copy link
Contributor

@majew7 majew7 commented Jun 23, 2020

Proposed Changes

  1. Introduce URL utility isSameOriginAsCurrentPage()
  2. Introduce URL utility removeOriginFromUrl()
  3. Ensure MatchFactory always identifies a non-match when the origins are different. And ensure origin is not present when rendering data-safelink-type="link"

Bug Revealed
Avoids incorrect rendering of data-safelink-type="link" when it shouldn't be, but rather simple anchor.
See PHX-570.
See screenshot:

CA_HelpCenter

@majew7 majew7 requested a review from jakiestfu June 24, 2020 00:09
@majew7 majew7 changed the title fix: ensure urls with different origins are not rendered as local Links fix: ensure urls with different origins are not rendered as local react-router-dom Links Jun 25, 2020
Copy link
Contributor

@jakiestfu jakiestfu left a comment

Choose a reason for hiding this comment

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

You will need to manually update the version in package.json, @majew7!

@majew7 majew7 merged commit 2e985a7 into master Jun 26, 2020
@majew7 majew7 deleted the fix-incorrect-render-bug branch June 26, 2020 17:20
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.

None yet

2 participants