Explorar o código

escape page path

Yuki Takei hai 1 ano
pai
achega
5e9dd86900
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      packages/core/src/utils/page-path-utils/index.ts

+ 1 - 1
packages/core/src/utils/page-path-utils/index.ts

@@ -286,7 +286,7 @@ export const generateChildrenRegExp = (path: string): RegExp => {
 
 
   // https://regex101.com/r/mrDJrx/1
   // https://regex101.com/r/mrDJrx/1
   // ex. /parent/any_child OR /any_level1
   // ex. /parent/any_child OR /any_level1
-  return new RegExp(`^${path}(\\/[^/]+)\\/?$`);
+  return new RegExp(`^${escapeStringRegexp(path)}(\\/[^/]+)\\/?$`);
 };
 };
 
 
 /**
 /**