Просмотр исходного кода

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

NOT allow to use double slash (`//`) in page path
Sotaro KARASAWA 9 лет назад
Родитель
Сommit
c846acf8d2
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      lib/models/page.js

+ 1 - 0
lib/models/page.js

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