Skip to content

Commit 3ea0d86

Browse files
authored
Don't escape script content (#7955)
1 parent 8f58bb3 commit 3ea0d86

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Microsoft.DotNet.Build.Tasks.Installers/src/GenerateMacOSDistributionFile.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ public override bool Execute()
4040

4141
var titleElement = new XElement("title", $"{ProductBrandName} ({TargetArchitecture})");
4242

43-
var archScriptContent = @"<![CDATA[
44-
function IsX64Machine() {
43+
var archScriptContent = @"function IsX64Machine() {
4544
var machine = system.sysctl(""hw.machine"");
4645
var cputype = system.sysctl(""hw.cputype"");
4746
var cpu64 = system.sysctl(""hw.cpu64bit_capable"");
@@ -59,9 +58,8 @@ function IsX64Machine() {
5958
result = result && (translated != ""1"");
6059
system.log(""IsX64Machine: "" + result);
6160
return result;
62-
}
63-
]]>";
64-
var scriptElement = new XElement("script", new XText(archScriptContent));
61+
}";
62+
var scriptElement = new XElement("script", new XCData(archScriptContent));
6563

6664
var choiceElements = BundledPackages
6765
.Select(component => new XElement("choice",

0 commit comments

Comments
 (0)