Fix sandbox check failure when compiling with latest .NET SDK. (#28077)
Roslyn now compiles char + string with string.Concat(ROS<char>). This means doing ref char -> ROS<char> which is not sandbox safe. Actually fixing this in the sandboxer is difficult so I'm gonna just pass on that for now.
This commit is contained in:
committed by
GitHub
parent
6c5b84a346
commit
b35dc427e1
@@ -68,7 +68,7 @@ public sealed partial class RCDMenu : RadialMenu
|
|||||||
tooltip = Loc.GetString(entProto.Name);
|
tooltip = Loc.GetString(entProto.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
tooltip = char.ToUpper(tooltip[0]) + tooltip.Remove(0, 1);
|
tooltip = OopsConcat(char.ToUpper(tooltip[0]).ToString(), tooltip.Remove(0, 1));
|
||||||
|
|
||||||
var button = new RCDMenuButton()
|
var button = new RCDMenuButton()
|
||||||
{
|
{
|
||||||
@@ -119,6 +119,12 @@ public sealed partial class RCDMenu : RadialMenu
|
|||||||
SendRCDSystemMessageAction += bui.SendRCDSystemMessage;
|
SendRCDSystemMessageAction += bui.SendRCDSystemMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static string OopsConcat(string a, string b)
|
||||||
|
{
|
||||||
|
// This exists to prevent Roslyn being clever and compiling something that fails sandbox checks.
|
||||||
|
return a + b;
|
||||||
|
}
|
||||||
|
|
||||||
private void AddRCDMenuButtonOnClickActions(Control control)
|
private void AddRCDMenuButtonOnClickActions(Control control)
|
||||||
{
|
{
|
||||||
var radialContainer = control as RadialContainer;
|
var radialContainer = control as RadialContainer;
|
||||||
|
|||||||
@@ -152,10 +152,16 @@ public abstract class SharedChatSystem : EntitySystem
|
|||||||
if (string.IsNullOrEmpty(message))
|
if (string.IsNullOrEmpty(message))
|
||||||
return message;
|
return message;
|
||||||
// Capitalize first letter
|
// Capitalize first letter
|
||||||
message = char.ToUpper(message[0]) + message.Remove(0, 1);
|
message = OopsConcat(char.ToUpper(message[0]).ToString(), message.Remove(0, 1));
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static string OopsConcat(string a, string b)
|
||||||
|
{
|
||||||
|
// This exists to prevent Roslyn being clever and compiling something that fails sandbox checks.
|
||||||
|
return a + b;
|
||||||
|
}
|
||||||
|
|
||||||
public string SanitizeMessageCapitalizeTheWordI(string message, string theWordI = "i")
|
public string SanitizeMessageCapitalizeTheWordI(string message, string theWordI = "i")
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(message))
|
if (string.IsNullOrEmpty(message))
|
||||||
|
|||||||
Reference in New Issue
Block a user