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

Escape link for tags #2984

Merged
merged 3 commits into from
Oct 8, 2019
Merged

Escape link for tags #2984

merged 3 commits into from
Oct 8, 2019

Conversation

ksami
Copy link
Contributor

@ksami ksami commented Oct 5, 2019

PR Checklist

Please check all that apply to this PR using "x":

  • I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
  • I have checked that this PR does not introduce a breaking change
  • This PR introduces breaking changes and I have provided a detailed explanation below

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting)
  • Refactoring (no functional changes)
  • Documentation changes
  • Other - Please describe:

Fixes

Issue Number: #2678

Escapes the generated link for tags by using encodeURIComponent

@neb-b
Copy link

neb-b commented Oct 6, 2019

Thanks for the pr!!

I'll give this a closer look soon but it looks good.

Copy link

@neb-b neb-b left a comment

Choose a reason for hiding this comment

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

One small change. Can you also add an addition to this file?
https://github.com/lbryio/lbry-desktop/blob/master/CHANGELOG.md

@@ -15,7 +15,7 @@ type Props = {
export default function Tag(props: Props) {
const { name, onClick, type = 'link', disabled = false } = props;
const isMature = MATURE_TAGS.includes(name);
const clickProps = onClick ? { onClick } : { navigate: `/$/tags?t=${name}` };
const clickProps = onClick ? { onClick } : { navigate: encodeURIComponent(`/$/tags?t=${name}`) };
Copy link

Choose a reason for hiding this comment

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

This should only wrap the name variable so the routing still works. Can you change this to

{ navigate: `/$/tags?t=${encodeURIComponent(name)}` };

Copy link
Contributor Author

@ksami ksami Oct 7, 2019

Choose a reason for hiding this comment

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

Oof sorry about that, I've fixed it. Also updated the changelog

@lbry-bot lbry-bot assigned neb-b and unassigned neb-b Oct 7, 2019
@neb-b neb-b added the hacktoberfest Welcome to Hacktoberfest label Oct 7, 2019
@neb-b neb-b merged commit 1d4a2d9 into lbryio:master Oct 8, 2019
@neb-b
Copy link

neb-b commented Oct 8, 2019

Merged! Thanks again for the PR!

@ksami
Copy link
Contributor Author

ksami commented Oct 8, 2019

Thanks for the guidance and being patient!

@tzarebczan
Copy link
Contributor

@ksami , thanks for the PR!

Can we show you some appreciation for the contribution?

Also, we're giving away some Hacktoberfest bonuses and goodies for this month. We'll get it all figured out after you shoot us an email after this is reviewed/merged.

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

Successfully merging this pull request may close these issues.

3 participants