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

Ampersand in query string gets incorrectly escaped #53

Closed
joppuyo opened this issue Feb 15, 2023 · 0 comments · Fixed by #57
Closed

Ampersand in query string gets incorrectly escaped #53

joppuyo opened this issue Feb 15, 2023 · 0 comments · Fixed by #57
Assignees
Labels
bug Something isn't working

Comments

@joppuyo
Copy link

joppuyo commented Feb 15, 2023

Describe the bug
This seems to be same issue as #5

To Reproduce

Write the following code

Meta::setHrefLang('zh-Hans', 'https://example.com/?foo=bar&lang=zh-hans');

Expected behavior

It outputs

<link rel="alternate" hreflang="zh-Hans" href="https://example.com/?foo=bar&amp;lang=zh-hans">

When it should output

<link rel="alternate" hreflang="zh-Hans" href="https://example.com/?foo=bar&lang=zh-hans">

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Currently I'm replacing all ampersands in my URLs with ESCAPED_AMPERSAND and then other way around after outputting the meta tags. It's not the best way to fix the issue but it works.

@butschster butschster self-assigned this Feb 15, 2023
@butschster butschster added the bug Something isn't working label Feb 15, 2023
@butschster butschster linked a pull request Sep 10, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants