fix: escape bootswatchSkin and homepageRoute

v1.18.x
Barış Soner Uşaklı 5 years ago
parent 3e52557689
commit b0f3e48ac2

@ -1,6 +1,8 @@
'use strict';
const validator = require('validator');
const meta = require('../meta');
const db = require('../database');
const plugins = require('../plugins');
@ -56,7 +58,8 @@ module.exports = function (User) {
settings.upvoteNotifFreq = getSetting(settings, 'upvoteNotifFreq', 'all');
settings.restrictChat = parseInt(getSetting(settings, 'restrictChat', 0), 10) === 1;
settings.topicSearchEnabled = parseInt(getSetting(settings, 'topicSearchEnabled', 0), 10) === 1;
settings.bootswatchSkin = settings.bootswatchSkin || '';
settings.bootswatchSkin = validator.escape(String(settings.bootswatchSkin || ''));
settings.homePageRoute = validator.escape(String(settings.homePageRoute || ''));
settings.scrollToMyPost = parseInt(getSetting(settings, 'scrollToMyPost', 1), 10) === 1;
settings.categoryWatchState = getSetting(settings, 'categoryWatchState', 'notwatching');

Loading…
Cancel
Save