Fixed regex so it only match urls that starts with lang

This commit is contained in:
Linus Flood
2024-10-10 11:05:00 +02:00
parent ec2790a16e
commit 3cf66e308b

View File

@@ -23,7 +23,7 @@ const useCheckIfExternal = (bookingUrl: string) => {
const bookingURL = new URL(bookingUrl)
const hostsMatch = hostName === bookingURL.hostname
const langRouteRegex = /\/[a-zA-Z]{2}\//
const langRouteRegex = /^\/[a-zA-Z]{2}\//
setIsExternal(!hostsMatch || !langRouteRegex.test(bookingURL.pathname))
}