From 5e6de2d7db2b834defb3fef8535bce00a4053aab Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Sun, 22 Jan 2023 14:07:08 -0500 Subject: [PATCH] Backport pull request #4243 from jellyfin/release-10.8.z Fix HTML escaping in MediaSession and on remote page Original-merge: ae907cd8a6d2114405f9f9d4d1ce502c10d6a0e8 Merged-by: Bill Thornton Backported-by: Joshua M. Boniface --- src/components/nowPlayingBar/nowPlayingBar.js | 4 ++-- src/components/playback/nowplayinghelper.js | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/nowPlayingBar/nowPlayingBar.js b/src/components/nowPlayingBar/nowPlayingBar.js index de61589f23..2bf29a2a9c 100644 --- a/src/components/nowPlayingBar/nowPlayingBar.js +++ b/src/components/nowPlayingBar/nowPlayingBar.js @@ -500,14 +500,14 @@ import { appRouter } from '../appRouter'; textLines[1].secondary = true; if (textLines[1].text) { const text = document.createElement('a'); - text.innerHTML = textLines[1].text; + text.innerText = textLines[1].text; secondaryText.appendChild(text); } } if (textLines[0].text) { const text = document.createElement('a'); - text.innerHTML = textLines[0].text; + text.innerText = textLines[0].text; itemText.appendChild(text); } nowPlayingTextElement.appendChild(itemText); diff --git a/src/components/playback/nowplayinghelper.js b/src/components/playback/nowplayinghelper.js index 507e689c7f..a2b72ca84f 100644 --- a/src/components/playback/nowplayinghelper.js +++ b/src/components/playback/nowplayinghelper.js @@ -1,5 +1,3 @@ -import escapeHtml from 'escape-html'; - export function getNowPlayingNames(nowPlayingItem, includeNonNameInfo) { let topItem = nowPlayingItem; let bottomItem = null; @@ -61,13 +59,13 @@ export function getNowPlayingNames(nowPlayingItem, includeNonNameInfo) { const list = []; list.push({ - text: escapeHtml(topText), + text: topText, item: topItem }); if (bottomText) { list.push({ - text: escapeHtml(bottomText), + text: bottomText, item: bottomItem }); }