|
@@ -1,7 +1,7 @@
|
|
|
module.exports = function(crowi, app) {
|
|
module.exports = function(crowi, app) {
|
|
|
'use strict';
|
|
'use strict';
|
|
|
|
|
|
|
|
- var debug = require('debug')('growi:routes:page')
|
|
|
|
|
|
|
+ const debug = require('debug')('growi:routes:page')
|
|
|
, logger = require('@alias/logger')('growi:routes:page')
|
|
, logger = require('@alias/logger')('growi:routes:page')
|
|
|
, Page = crowi.model('Page')
|
|
, Page = crowi.model('Page')
|
|
|
, User = crowi.model('User')
|
|
, User = crowi.model('User')
|
|
@@ -9,7 +9,6 @@ module.exports = function(crowi, app) {
|
|
|
, config = crowi.getConfig()
|
|
, config = crowi.getConfig()
|
|
|
, Revision = crowi.model('Revision')
|
|
, Revision = crowi.model('Revision')
|
|
|
, Bookmark = crowi.model('Bookmark')
|
|
, Bookmark = crowi.model('Bookmark')
|
|
|
- , UserGroupRelation = crowi.model('UserGroupRelation')
|
|
|
|
|
, PageGroupRelation = crowi.model('PageGroupRelation')
|
|
, PageGroupRelation = crowi.model('PageGroupRelation')
|
|
|
, UpdatePost = crowi.model('UpdatePost')
|
|
, UpdatePost = crowi.model('UpdatePost')
|
|
|
, ApiResponse = require('../util/apiResponse')
|
|
, ApiResponse = require('../util/apiResponse')
|
|
@@ -601,7 +600,7 @@ module.exports = function(crowi, app) {
|
|
|
// これ以前に定義されているはずなので、こうしてしまって問題ない。
|
|
// これ以前に定義されているはずなので、こうしてしまって問題ない。
|
|
|
if (!Page.isCreatableName(path)) {
|
|
if (!Page.isCreatableName(path)) {
|
|
|
// 削除済みページの場合 /trash 以下に移動しているので creatableName になっていないので、表示を許可
|
|
// 削除済みページの場合 /trash 以下に移動しているので creatableName になっていないので、表示を許可
|
|
|
- debug('Page is not creatable name.', path);
|
|
|
|
|
|
|
+ logger.warn('Page is not creatable name.', path);
|
|
|
res.redirect('/');
|
|
res.redirect('/');
|
|
|
return ;
|
|
return ;
|
|
|
}
|
|
}
|
|
@@ -619,9 +618,9 @@ module.exports = function(crowi, app) {
|
|
|
return res.redirect(pagePathUtil.encodePagePath(path) + '/');
|
|
return res.redirect(pagePathUtil.encodePagePath(path) + '/');
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
- var fixed = Page.fixToCreatableName(path);
|
|
|
|
|
|
|
+ const fixed = Page.fixToCreatableName(path);
|
|
|
if (fixed !== path) {
|
|
if (fixed !== path) {
|
|
|
- debug('fixed page name', fixed);
|
|
|
|
|
|
|
+ logger.warn('fixed page name', fixed);
|
|
|
res.redirect(pagePathUtil.encodePagePath(fixed));
|
|
res.redirect(pagePathUtil.encodePagePath(fixed));
|
|
|
return ;
|
|
return ;
|
|
|
}
|
|
}
|