Skip to content

Commit

Permalink
Added functionality to display & character instead of &amp on theme c…
Browse files Browse the repository at this point in the history
…reation.
  • Loading branch information
Michaellinaresxk committed Aug 29, 2023
1 parent 69811ad commit 38c35f3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions controllers/teams.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const _ = require('lodash');
const express = require('express');
const moment = require('moment');
const { Configuration } = require('@hpi-schul-cloud/commons');
const { decode } = require('html-entities');

const authHelper = require('../helpers/authentication');
const recurringEventsHelper = require('../helpers/recurringEvents');
Expand Down Expand Up @@ -427,8 +428,9 @@ router.get('/:teamId/json', (req, res, next) => {
return permission;
});

if (team.description) {
team.description = team.description.replace(/&/g, '&');
if (team.description && team.name) {
team.description = decode(team.description);
team.name = decode(team.name);
}

res.json({ team });
Expand Down Expand Up @@ -477,8 +479,9 @@ router.get('/:teamId', async (req, res, next) => {
},
});

if (course.description) {
course.description = course.description.replace(/&/g, '&');
if (course.description && course.name) {
course.description = decode(course.description);
course.name = decode(course.name);
}

let instanceUsesRocketChat = Configuration.get('ROCKETCHAT_SERVICE_ENABLED');
Expand Down

0 comments on commit 38c35f3

Please sign in to comment.