diff options
Diffstat (limited to 'MediaBrowser.WebDashboard/Api/PackageCreator.cs')
| -rw-r--r-- | MediaBrowser.WebDashboard/Api/PackageCreator.cs | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.cs index 133bf61e8..ad996c5a9 100644 --- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs +++ b/MediaBrowser.WebDashboard/Api/PackageCreator.cs @@ -1,4 +1,7 @@ +#pragma warning disable CS1591 + using System; +using System.Globalization; using System.IO; using System.Text; using System.Threading.Tasks; @@ -44,10 +47,7 @@ namespace MediaBrowser.WebDashboard.Api return string.Equals(Path.GetExtension(path), ".html", StringComparison.OrdinalIgnoreCase); } - /// <summary> - /// Modifies the HTML by adding common meta tags, css and js. - /// </summary> - /// <returns>Task{Stream}.</returns> + // Modifies the HTML by adding common meta tags, css and js. public async Task<Stream> ModifyHtml( string path, Stream sourceStream, @@ -67,30 +67,29 @@ namespace MediaBrowser.WebDashboard.Api { var lang = localizationCulture.Split('-')[0]; - html = html.Replace("<html", "<html data-culture=\"" + localizationCulture + "\" lang=\"" + lang + "\""); + html = html.Replace("<html", "<html data-culture=\"" + localizationCulture + "\" lang=\"" + lang + "\"", StringComparison.Ordinal); } if (isMainIndexPage) { - html = html.Replace("<head>", "<head>" + GetMetaTags(mode)); + html = html.Replace("<head>", "<head>" + GetMetaTags(mode), StringComparison.Ordinal); } // Disable embedded scripts from plugins. We'll run them later once resources have loaded if (html.IndexOf("<script", StringComparison.OrdinalIgnoreCase) != -1) { - html = html.Replace("<script", "<!--<script"); - html = html.Replace("</script>", "</script>-->"); + html = html.Replace("<script", "<!--<script", StringComparison.Ordinal); + html = html.Replace("</script>", "</script>-->", StringComparison.Ordinal); } if (isMainIndexPage) { - html = html.Replace("</body>", GetCommonJavascript(mode, appVersion) + "</body>"); + html = html.Replace("</body>", GetCommonJavascript(mode, appVersion) + "</body>", StringComparison.Ordinal); } var bytes = Encoding.UTF8.GetBytes(html); return new MemoryStream(bytes); - } /// <summary> @@ -123,11 +122,11 @@ namespace MediaBrowser.WebDashboard.Api builder.Append("<script>"); if (!string.IsNullOrWhiteSpace(mode)) { - builder.AppendFormat("window.appMode='{0}';", mode); + builder.AppendFormat(CultureInfo.InvariantCulture, "window.appMode='{0}';", mode); } else { - builder.AppendFormat("window.dashboardVersion='{0}';", version); + builder.AppendFormat(CultureInfo.InvariantCulture, "window.dashboardVersion='{0}';", version); } builder.Append("</script>"); |
