diff --git a/src/backend/routes/PublicRouter.ts b/src/backend/routes/PublicRouter.ts index 91db9e5b..8c6e424a 100644 --- a/src/backend/routes/PublicRouter.ts +++ b/src/backend/routes/PublicRouter.ts @@ -78,7 +78,15 @@ export class PublicRouter { res.tpl.user.csrfToken = req.csrfToken(); } } - res.tpl.Config = {Client: Config.Client.toJSON({attachVolatile: true})}; + const confCopy = {Client: Config.Client.toJSON({attachVolatile: true})}; + // Escaping html tags, like + confCopy.Client.Other.customHTMLHead = confCopy.Client.Other.customHTMLHead.replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); + res.tpl.Config = confCopy; + res.tpl.customHTMLHead = Config.Client.Other.customHTMLHead; return next(); }); diff --git a/src/common/config/public/ClientConfig.ts b/src/common/config/public/ClientConfig.ts index bee3c57a..52961fcf 100644 --- a/src/common/config/public/ClientConfig.ts +++ b/src/common/config/public/ClientConfig.ts @@ -111,6 +111,8 @@ export class NavBarConfig { @SubConfigClass() export class ClientOtherConfig { + @ConfigProperty() + customHTMLHead: string = ''; @ConfigProperty() enableCache: boolean = true; @ConfigProperty() diff --git a/src/frontend/app/ui/settings/other/other.settings.component.html b/src/frontend/app/ui/settings/other/other.settings.component.html index 788e6d9b..dcb13475 100644 --- a/src/frontend/app/ui/settings/other/other.settings.component.html +++ b/src/frontend/app/ui/settings/other/other.settings.component.html @@ -105,6 +105,14 @@ required="true"> + + +