diff options
| author | Luke Foust <luke@foust.com> | 2020-03-20 12:53:52 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-20 12:53:52 -0700 |
| commit | dcd0d93f44bf1befea5e61993bc868b5846102a0 (patch) | |
| tree | 740f132fce52947fc8a73621588ca36c3447922a /MediaBrowser.WebDashboard/Api/PackageCreator.cs | |
| parent | 80dfc78ba5ec3895fd374a5bd761d0d0e9e6a862 (diff) | |
| parent | e028fb6fdefa6120fc6109c63d883d21412c31bd (diff) | |
Merge pull request #1 from jellyfin/master
merge with upstream master
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>"); |
