Browse Source

Merge pull request #168 from crowi/add-avoid-path-pattern

NOT allow to use double slash (`//`) in page path
Sotaro KARASAWA 9 years ago
parent
commit
c846acf8d2
1 changed files with 1 additions and 0 deletions
  1. 1 0
      lib/models/page.js

+ 1 - 0
lib/models/page.js

@@ -383,6 +383,7 @@ module.exports = function(crowi) {
       /^\/_r\/.*/,
       /^\/_r\/.*/,
       /^\/user\/[^\/]+\/(bookmarks|comments|activities|pages|recent-create|recent-edit)/, // reserved
       /^\/user\/[^\/]+\/(bookmarks|comments|activities|pages|recent-create|recent-edit)/, // reserved
       /^\/?https?:\/\/.+$/, // avoid miss in renaming
       /^\/?https?:\/\/.+$/, // avoid miss in renaming
+      /\/{2,}/,             // avoid miss in renaming
       /.+\/edit$/,
       /.+\/edit$/,
       /.+\.md$/,
       /.+\.md$/,
       /^\/(installer|register|login|logout|admin|me|files|trash|paste|comments)(\/.*|$)/,
       /^\/(installer|register|login|logout|admin|me|files|trash|paste|comments)(\/.*|$)/,