Use safe URI decoding.
This commit is contained in:
1 parent
a509336bef
commit
b3cad83f08
3 files changed
+6
-4
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { useMemo } from 'react';
|
||||
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
|
||||
import { buildUrl } from 'next-basics';
|
||||
import { buildUrl, safeDecodeURIComponent } from 'next-basics';
|
||||
|
||||
export function useNavigation(): {
|
||||
pathname: string;
|
||||
@@ -16,7 +16,7 @@ export function useNavigation(): {
|
||||
const obj = {};
|
||||
|
||||
for (const [key, value] of params.entries()) {
|
||||
obj[key] = decodeURIComponent(value);
|
||||
obj[key] = safeDecodeURIComponent(value);
|
||||
}
|
||||
|
||||
return obj;
|
||||
|
||||
Reference in new issue
Block a user