diff --git a/src/components/cardbuilder/cardBuilder.js b/src/components/cardbuilder/cardBuilder.js index 7826cf2f81..6ce72d08b1 100644 --- a/src/components/cardbuilder/cardBuilder.js +++ b/src/components/cardbuilder/cardBuilder.js @@ -949,7 +949,7 @@ import ServerConnections from '../ServerConnections'; }, item.ChannelName)); } else { - lines.push(escapeHtml(item.ChannelName) || ' '); + lines.push(escapeHtml(item.ChannelName || '') || ' '); } } @@ -981,7 +981,7 @@ import ServerConnections from '../ServerConnections'; if (item.RecordAnyChannel) { lines.push(globalize.translate('AllChannels')); } else { - lines.push(escapeHtml(item.ChannelName) || globalize.translate('OneChannel')); + lines.push(escapeHtml(item.ChannelName || '') || globalize.translate('OneChannel')); } } diff --git a/src/components/dashboard/users/CheckBoxListItem.tsx b/src/components/dashboard/users/CheckBoxListItem.tsx index 292f519711..02f7560e5f 100644 --- a/src/components/dashboard/users/CheckBoxListItem.tsx +++ b/src/components/dashboard/users/CheckBoxListItem.tsx @@ -1,3 +1,4 @@ +import escapeHtml from 'escape-html'; import React, { FunctionComponent } from 'react'; type IProps = { @@ -17,7 +18,7 @@ const createCheckBoxElement = ({className, Name, dataAttributes, AppName, checke class="${className}" ${dataAttributes} ${checkedAttribute} /> - ${Name} ${AppName} + ${escapeHtml(Name || '')} ${AppName} ` }); diff --git a/src/components/directorybrowser/directorybrowser.js b/src/components/directorybrowser/directorybrowser.js index ceb47b4438..625523483d 100644 --- a/src/components/directorybrowser/directorybrowser.js +++ b/src/components/directorybrowser/directorybrowser.js @@ -267,7 +267,7 @@ class DirectoryBrowser { html += '
'; html += ``; html += '

'; - html += escapeHtml(options.header) || globalize.translate('HeaderSelectPath'); + html += escapeHtml(options.header || '') || globalize.translate('HeaderSelectPath'); html += '

'; html += '
'; html += getEditorHtml(options, systemInfo); diff --git a/src/components/itemidentifier/itemidentifier.js b/src/components/itemidentifier/itemidentifier.js index eae3257513..976e54f6f0 100644 --- a/src/components/itemidentifier/itemidentifier.js +++ b/src/components/itemidentifier/itemidentifier.js @@ -246,7 +246,7 @@ import template from './itemidentifier.template.html'; } else { html += '
'; } - html += escapeHtml(lines[i]) || ' '; + html += escapeHtml(lines[i] || '') || ' '; html += '
'; } diff --git a/src/controllers/dashboard/notifications/notification/index.js b/src/controllers/dashboard/notifications/notification/index.js index 2b562ea073..b0841859c5 100644 --- a/src/controllers/dashboard/notifications/notification/index.js +++ b/src/controllers/dashboard/notifications/notification/index.js @@ -38,7 +38,7 @@ function reload(page) { $('.monitorUsers', page).hide(); } - $('.notificationType', page).html(escapeHtml(typeInfo.Name) || 'Unknown Notification'); + $('.notificationType', page).html(escapeHtml(typeInfo.Name || '') || 'Unknown Notification'); if (!notificationConfig) { notificationConfig = { diff --git a/src/controllers/itemDetails/index.js b/src/controllers/itemDetails/index.js index 9e90345841..5272e51dfc 100644 --- a/src/controllers/itemDetails/index.js +++ b/src/controllers/itemDetails/index.js @@ -450,7 +450,7 @@ function renderName(item, container, context) { } else if (item.ParentIndexNumber != null && item.Type === 'Episode') { parentNameHtml.push(`${escapeHtml(item.SeasonName)}`); } else if (item.ParentIndexNumber != null && item.IsSeries) { - parentNameHtml.push(escapeHtml(item.SeasonName) || 'S' + item.ParentIndexNumber); + parentNameHtml.push(escapeHtml(item.SeasonName || 'S' + item.ParentIndexNumber)); } else if (item.Album && item.AlbumId && (item.Type === 'MusicVideo' || item.Type === 'Audio')) { parentNameHtml.push(`${escapeHtml(item.Album)}`); } else if (item.Album) {