fix: unescape header navigation originalRoute [breaking]

v1.18.x
Julian Lam 4 years ago
parent 03a0e72fae
commit 6cb5888c13

@ -177,7 +177,7 @@ async function appendUnreadCounts({ uid, navigation, unreadData }) {
const tidsByFilter = results.unreadData.tidsByFilter;
navigation = navigation.map(function (item) {
function modifyNavItem(item, route, filter, content) {
if (item && validator.unescape(item.originalRoute) === route) {
if (item && item.originalRoute === route) {
unreadData[filter] = _.zipObject(tidsByFilter[filter], tidsByFilter[filter].map(() => true));
item.content = content;
if (unreadCounts[filter] > 0) {

@ -1,6 +1,7 @@
'use strict';
const nconf = require('nconf');
const validator = require('validator');
const admin = require('./admin');
const groups = require('../groups');
@ -12,7 +13,7 @@ navigation.get = async function (uid) {
let data = await admin.get();
data = data.filter(item => item && item.enabled).map(function (item) {
item.originalRoute = item.route;
item.originalRoute = validator.unescape(item.route);
if (!item.route.startsWith('http')) {
item.route = relative_path + item.route;

Loading…
Cancel
Save