butschster / LaravelMetaTags

The most powerful and extendable tools for managing SEO Meta Tags in your Laravel project
MIT License
547 stars 51 forks source link

Ampersand in query string gets incorrectly escaped #53

Closed joppuyo closed 1 year ago

joppuyo commented 1 year ago

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):

Smartphone (please complete the following information):

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.