FriendsOfShopware / FroshShareBasket

This plugin allows your customers to save the current basket and share it via link.
MIT License
8 stars 5 forks source link

Fix attribute fetching if hostname contains `backend` #19

Closed christiansteinhart closed 4 years ago

christiansteinhart commented 4 years ago

18

Both protocol and host are supported by all desktop browsers.

https://developer.mozilla.org/en-US/docs/Web/API/Location/protocol https://developer.mozilla.org/en-US/docs/Web/API/Location/host

shyim commented 4 years ago

that does not work in subfolder installations

christiansteinhart commented 4 years ago

I have updated the PR, removing the combining of the URL back to the original one, but switched the indexOf to lastIndexOf. I have not yet encountered a situation where the Shopware Backend displayed a second backend piece in the URL when navigating to the Plugin Manager or the Basic Settings.

In addition this should cover as well any problems occuring from subfolder installations which would contain the word backend like my.example.domain/backende-muttis/backend.

shyim commented 4 years ago

Thanks for your Contribution! 💙