mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 21:40:39 +03:00
Fixed redirects.json file validation
refs #10790
- Reference to method previously used to validate wasn't updated during refactoring done in be27db46eb
This commit is contained in:
parent
8ae5db9922
commit
22f56c95a8
@ -1,5 +1,9 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
get settings() {
|
get settings() {
|
||||||
return require('./settings');
|
return require('./settings');
|
||||||
|
},
|
||||||
|
|
||||||
|
get validation() {
|
||||||
|
return require('./validation');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -5,7 +5,7 @@ const path = require('path');
|
|||||||
const debug = require('ghost-ignition').debug('web:shared:mw:custom-redirects');
|
const debug = require('ghost-ignition').debug('web:shared:mw:custom-redirects');
|
||||||
const config = require('../../../config');
|
const config = require('../../../config');
|
||||||
const common = require('../../../lib/common');
|
const common = require('../../../lib/common');
|
||||||
const validation = require('../../../data/validation');
|
const redirectsService = require('../../../../frontend/services/redirects');
|
||||||
|
|
||||||
const _private = {};
|
const _private = {};
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ _private.registerRoutes = () => {
|
|||||||
try {
|
try {
|
||||||
let redirects = fs.readFileSync(path.join(config.getContentPath('data'), 'redirects.json'), 'utf-8');
|
let redirects = fs.readFileSync(path.join(config.getContentPath('data'), 'redirects.json'), 'utf-8');
|
||||||
redirects = JSON.parse(redirects);
|
redirects = JSON.parse(redirects);
|
||||||
validation.validateRedirects(redirects);
|
redirectsService.validation.validate(redirects);
|
||||||
|
|
||||||
redirects.forEach((redirect) => {
|
redirects.forEach((redirect) => {
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user