@@ -11,6 +11,7 @@ import qs from "qs";
1111import React , { type ComponentProps , useCallback , useContext } from "react" ;
1212import { paramsFromCurrentPath } from "./params-from-current-path" ;
1313import { convertToNumberIfPossible } from "./convert-to-number-if-possible" ;
14+ import { safeDecodeURIComponent } from "./safe-decode-uri-component" ;
1415
1516export const stringifyConfig = {
1617 addQueryPrefix : true ,
@@ -116,8 +117,8 @@ export const routerProvider: RouterProvider = {
116117 const response : ParseResponse = {
117118 ...( resource && { resource } ) ,
118119 ...( action && { action } ) ,
119- ...( inferredId && { id : decodeURIComponent ( inferredId ) } ) ,
120- ...( params ?. id && { id : decodeURIComponent ( params . id ) } ) ,
120+ ...( inferredId && { id : safeDecodeURIComponent ( inferredId ) } ) ,
121+ ...( params ?. id && { id : safeDecodeURIComponent ( params . id ) } ) ,
121122 // ...(params?.action && { action: params.action }), // lets see if there is a need for this
122123 pathname,
123124 params : {
@@ -129,7 +130,7 @@ export const routerProvider: RouterProvider = {
129130 combinedParams . pageSize as string ,
130131 ) as number | undefined ,
131132 to : combinedParams . to
132- ? decodeURIComponent ( combinedParams . to as string )
133+ ? safeDecodeURIComponent ( combinedParams . to as string )
133134 : undefined ,
134135 } ,
135136 } ;
0 commit comments