Closed anafro closed 11 months ago
I added a test into Ziggy that tests this, and it passes, but I found something:
When there are cyrillic letters in URI opened in browser, window.location.href
returns not http://localhost:8000/магазин
, for example, but http://localhost:8000/%D0%BC%D0%B0%D0%B3%D0%B0%D0%B7%D0%B8%D0%BD
.
I think Ziggy should decode %XX codes into actual URI or encode route URI-s into %XX codes
Temporary solution for checking if the route is current:
// Now we are at example.com/магазин
const checkingRoute = 'store';
const isCurrent = window.location.href.endsWith(encodeURI(route(checkingRoute))); // true
Ziggy version
v1.6.2
Laravel version
v10.20.0
Description
route().current()
doesn't work when url is cyrillic.E.g.:
but
route().current()
also returns the same results when invoked right inside Chrome's console.Ziggy call and context
Ziggy configuration
Route definition