Node.js based forum software built for the modern web
fix: escape bootswatchSkin and homepageRoute
Barış Soner Uşaklıb0f3e48ac2ed
diff --git a/src/user/settings.js b/src/user/settings.jsindex 82dde7d493..0a1ca94839 100644--- a/src/user/settings.js+++ b/src/user/settings.js@@ -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');