Ensure uri components are decoded (#11920)

This commit is contained in:
Josh Hawkins
2024-06-12 16:03:00 -05:00
committed by GitHub
parent 2d4d1584fd
commit 187d98a153

View File

@@ -109,9 +109,15 @@ export function useSearchEffect(
const params = location.search.substring(1).split("&");
return params
const foundParam = params
.find((p) => p.includes("=") && p.split("=")[0] == key)
?.split("=");
if (foundParam && foundParam.length === 2) {
return [foundParam[0], decodeURIComponent(foundParam[1])];
}
return undefined;
}, [location, key]);
useEffect(() => {