feat: #7467, pass query params when redirecting to posts

v1.18.x
Barış Soner Uşaklı 5 years ago
parent b5a30006e2
commit 480a64aaa7

@ -1,5 +1,7 @@
'use strict'; 'use strict';
const querystring = require('querystring');
const posts = require('../posts'); const posts = require('../posts');
const privileges = require('../privileges'); const privileges = require('../privileges');
const helpers = require('./helpers'); const helpers = require('./helpers');
@ -22,7 +24,9 @@ postsController.redirectToPost = async function (req, res, next) {
if (!canRead) { if (!canRead) {
return helpers.notAllowed(req, res); return helpers.notAllowed(req, res);
} }
helpers.redirect(res, path);
const qs = querystring.stringify(req.query);
helpers.redirect(res, qs ? path + '?' + qs : path);
}; };
postsController.getRecentPosts = async function (req, res) { postsController.getRecentPosts = async function (req, res) {

@ -169,6 +169,7 @@ async function setupMockDefaults() {
meta.config.postDelay = 0; meta.config.postDelay = 0;
meta.config.initialPostDelay = 0; meta.config.initialPostDelay = 0;
meta.config.newbiePostDelay = 0; meta.config.newbiePostDelay = 0;
meta.config.autoDetectLang = 0;
await enableDefaultPlugins(); await enableDefaultPlugins();

Loading…
Cancel
Save