The Free Software Media System - Server Backend & API
Fix build and more Append calls
Bond_00965453c0a8404
diff --git a/Emby.Dlna/PlayTo/Device.cs b/Emby.Dlna/PlayTo/Device.csindex c5080b90f3..72834c69d1 100644--- a/Emby.Dlna/PlayTo/Device.cs+++ b/Emby.Dlna/PlayTo/Device.cs@@ -4,12 +4,12 @@ using System;using System.Collections.Generic;using System.Globalization;using System.Linq;+using System.Security;using System.Threading;using System.Threading.Tasks;using System.Xml;using System.Xml.Linq;using Emby.Dlna.Common;-using Emby.Dlna.Server;using Emby.Dlna.Ssdp;using MediaBrowser.Common.Net;using MediaBrowser.Controller.Configuration;@@ -334,7 +334,7 @@ namespace Emby.Dlna.PlayToreturn string.Empty;}- return DescriptionXmlBuilder.Escape(value);+ return SecurityElement.Escape(value);}private Task SetPlay(TransportCommands avCommands, CancellationToken cancellationToken)diff --git a/Emby.Dlna/Server/DescriptionXmlBuilder.cs b/Emby.Dlna/Server/DescriptionXmlBuilder.csindex 4a19061d71..bca9e81cd0 100644--- a/Emby.Dlna/Server/DescriptionXmlBuilder.cs+++ b/Emby.Dlna/Server/DescriptionXmlBuilder.cs@@ -65,7 +65,7 @@ namespace Emby.Dlna.Serverforeach (var att in attributes){- builder.AppendFormat(" {0}=\"{1}\"", att.Name, att.Value);+ builder.AppendFormat(CultureInfo.InvariantCulture, " {0}=\"{1}\"", att.Name, att.Value);}builder.Append('>');diff --git a/Emby.Dlna/Service/ServiceXmlBuilder.cs b/Emby.Dlna/Service/ServiceXmlBuilder.csindex af557aa144..6c7d6f8462 100644--- a/Emby.Dlna/Service/ServiceXmlBuilder.cs+++ b/Emby.Dlna/Service/ServiceXmlBuilder.cs@@ -1,9 +1,9 @@#pragma warning disable CS1591using System.Collections.Generic;+using System.Security;using System.Text;using Emby.Dlna.Common;-using Emby.Dlna.Server;namespace Emby.Dlna.Service{@@ -37,7 +37,9 @@ namespace Emby.Dlna.Service{builder.Append("<action>");- builder.Append("<name>" + DescriptionXmlBuilder.Escape(item.Name ?? string.Empty) + "</name>");+ builder.Append("<name>")+ .Append(SecurityElement.Escape(item.Name ?? string.Empty))+ .Append("</name>");builder.Append("<argumentList>");@@ -45,9 +47,15 @@ namespace Emby.Dlna.Service{builder.Append("<argument>");- builder.Append("<name>" + DescriptionXmlBuilder.Escape(argument.Name ?? string.Empty) + "</name>");- builder.Append("<direction>" + DescriptionXmlBuilder.Escape(argument.Direction ?? string.Empty) + "</direction>");- builder.Append("<relatedStateVariable>" + DescriptionXmlBuilder.Escape(argument.RelatedStateVariable ?? string.Empty) + "</relatedStateVariable>");+ builder.Append("<name>")+ .Append(SecurityElement.Escape(argument.Name ?? string.Empty))+ .Append("</name>");+ builder.Append("<direction>")+ .Append(SecurityElement.Escape(argument.Direction ?? string.Empty))+ .Append("</direction>");+ builder.Append("<relatedStateVariable>")+ .Append(SecurityElement.Escape(argument.RelatedStateVariable ?? string.Empty))+ .Append("</relatedStateVariable>");builder.Append("</argument>");}@@ -68,17 +76,25 @@ namespace Emby.Dlna.Service{var sendEvents = item.SendsEvents ? "yes" : "no";- builder.Append("<stateVariable sendEvents=\"" + sendEvents + "\">");+ builder.Append("<stateVariable sendEvents=\"")+ .Append(sendEvents)+ .Append("\">");- builder.Append("<name>" + DescriptionXmlBuilder.Escape(item.Name ?? string.Empty) + "</name>");- builder.Append("<dataType>" + DescriptionXmlBuilder.Escape(item.DataType ?? string.Empty) + "</dataType>");+ builder.Append("<name>")+ .Append(SecurityElement.Escape(item.Name ?? string.Empty))+ .Append("</name>");+ builder.Append("<dataType>")+ .Append(SecurityElement.Escape(item.DataType ?? string.Empty))+ .Append("</dataType>");if (item.AllowedValues.Length > 0){builder.Append("<allowedValueList>");foreach (var allowedValue in item.AllowedValues){- builder.Append("<allowedValue>" + DescriptionXmlBuilder.Escape(allowedValue) + "</allowedValue>");+ builder.Append("<allowedValue>")+ .Append(SecurityElement.Escape(allowedValue))+ .Append("</allowedValue>");}builder.Append("</allowedValueList>");