Explorar o código

fix #631 escape path

utsushiiro %!s(int64=7) %!d(string=hai) anos
pai
achega
97bc0743ad
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/server/models/page.js

+ 1 - 1
src/server/models/page.js

@@ -540,7 +540,7 @@ module.exports = function(crowi) {
     const Page = this;
     const templatePath = cutOffLastSlash(path);
     const pathList = generatePathsOnTree(templatePath, []);
-    const regexpList = pathList.map(path => new RegExp(`^${path}/_{1,2}template$`));
+    const regexpList = pathList.map(path => new RegExp(`^${escapeStringRegexp(path)}/_{1,2}template$`));
 
     return Page
       .find({path: {$in: regexpList}})