fix: Cleans up FixHtml (#1757)

This commit is contained in:
Kamron Batman 2024-05-03 21:24:31 -07:00 • committed by GitHub
parent af67c48621
commit becd7aad05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 69 additions and 63 deletions

View file

@ -158,7 +158,7 @@ namespace Server.Commands
return false;
}
if (Condition.Length > 0 && !Utility.InsensitiveStartsWith(Condition, "where"))
if (Condition.Length > 0 && !Condition.InsensitiveStartsWith("where"))
{
from.SendMessage("The condition field must start with \"where\".");
return false;

View file

@ -287,7 +287,7 @@ public partial class BulkOrderBook : Item, ISecurable
if (from.CheckAlive() && m_Book.IsChildOf(from.Backpack))
{
m_Book.BookName = Utility.FixHtml(text.Trim());
m_Book.BookName = text.Trim().FixHtml();
from.SendLocalizedMessage(1062480); // The bulk order book's name has been changed.
}

View file

@ -34,7 +34,7 @@ namespace Server.Engines.Help
{
Sender = sender;
Sent = Core.Now;
Message = Utility.FixHtml(message);
Message = message.FixHtml();
Type = type;
PageLocation = sender.Location;
PageMap = sender.Map;

View file

@ -46,7 +46,7 @@ namespace Server.Engines.Help
10,
280,
20,
$"<basefont color=#A0A0FF><center>SPEECH LOG - {playerName} (<i>{Utility.FixHtmlFormattable(playerAccount)}</i>)</center></basefont>"
$"<basefont color=#A0A0FF><center>SPEECH LOG - {playerName} (<i>{playerAccount.FixHtmlFormattable()}</i>)</center></basefont>"
);
var lastPage = (log.Count - 1) / MaxEntriesPerPage;
@ -82,8 +82,8 @@ namespace Server.Engines.Help
builder.AppendFormat(
"<u>{0}</u> (<i>{1}</i>): {2}",
name,
Utility.FixHtml(account),
Utility.FixHtml(speech)
account.FixHtml(),
speech.FixHtml()
);
}

View file

@ -53,8 +53,8 @@ namespace Server.Guilds
{
case 1:
{
var guildName = Utility.FixHtml(info.GetTextEntry(5) ?? "");
var guildAbbrev = Utility.FixHtml(info.GetTextEntry(6) ?? "");
var guildName = (info.GetTextEntry(5) ?? "").FixHtml();
var guildAbbrev = (info.GetTextEntry(6) ?? "").FixHtml();
if (guildName.Length <= 0)
{

View file

@ -173,7 +173,7 @@ namespace Server.Guilds
return;
}
var charter = Utility.FixHtml(text.Trim());
var charter = text.Trim().FixHtml();
if (charter.Length > 50)
{
@ -193,7 +193,7 @@ namespace Server.Guilds
return;
}
var site = Utility.FixHtml(text.Trim());
var site = text.Trim().FixHtml();
if (site.Length > 50)
{

View file

@ -265,7 +265,7 @@ namespace Server.Guilds
return;
}
var title = Utility.FixHtml(text.Trim());
var title = text.Trim().FixHtml();
if (title.Length > 20)
{

View file

@ -677,7 +677,7 @@ namespace Server.Guilds
}
else
{
var name = Utility.FixHtml(text.Trim());
var name = text.Trim().FixHtml();
if (!CheckProfanity(name))
{

View file

@ -480,7 +480,7 @@ namespace Server.Gumps
if (m_Book.CheckAccess(from))
{
m_Book.Description = Utility.FixHtml(text.Trim());
m_Book.Description = text.Trim().FixHtml();
from.CloseGump<RunebookGump>();
from.SendGump(new RunebookGump(from, m_Book));

View file

@ -175,9 +175,9 @@ namespace Server.Items
m_Bear.EditLimit = Core.Now + TimeSpan.FromMinutes(10);
}
m_Bear.Line1 = Utility.FixHtml(line1);
m_Bear.Line2 = Utility.FixHtml(line2);
m_Bear.Line3 = Utility.FixHtml(line3);
m_Bear.Line1 = line1.FixHtml();
m_Bear.Line2 = line2.FixHtml();
m_Bear.Line3 = line3.FixHtml();
from.SendMessage("You add the personalized greeting to your St. Valentine Bear.");
}

View file

@ -44,8 +44,8 @@ namespace Server.Items
var title = reader.ReadAsciiSafe(60);
var author = reader.ReadAsciiSafe(30);
book.Title = Utility.FixHtml(title);
book.Author = Utility.FixHtml(author);
book.Title = title.FixHtml();
book.Author = author.FixHtml();
}
public static void HeaderChange(NetState state, SpanReader reader)
@ -80,8 +80,8 @@ namespace Server.Items
var author = reader.ReadUTF8Safe(authorLength);
book.Title = Utility.FixHtml(title);
book.Author = Utility.FixHtml(author);
book.Title = title.FixHtml();
book.Author = author.FixHtml();
}
public static void ContentChange(NetState state, SpanReader reader)

View file

@ -114,11 +114,11 @@ public partial class Guildstone : Item, IAddon, IChoppable
}
// list.Add( 1060802, Utility.FixHtml( name ) ); // Guild name: ~1_val~
list.Add(1060802, $"{Utility.FixHtmlFormattable(name)} [{Utility.FixHtmlFormattable(abbr)}]");
list.Add(1060802, $"{name.FixHtmlFormattable()} [{abbr.FixHtmlFormattable()}]");
}
else if (_guildName != null && _guildAbbrev != null)
{
list.Add(1060802, $"{Utility.FixHtmlFormattable(_guildName)} [{Utility.FixHtmlFormattable(_guildAbbrev)}]");
list.Add(1060802, $"{_guildName.FixHtmlFormattable()} [{_guildAbbrev.FixHtmlFormattable()}]");
}
}
@ -254,11 +254,11 @@ public partial class GuildstoneDeed : Item
}
// list.Add( 1060802, Utility.FixHtml( name ) ); // Guild name: ~1_val~
list.Add(1060802, $"{Utility.FixHtmlFormattable(name)} [{Utility.FixHtmlFormattable(abbr)}]");
list.Add(1060802, $"{name.FixHtmlFormattable()} [{abbr.FixHtmlFormattable()}]");
}
else if (_guildName != null && _guildAbbrev != null)
{
list.Add(1060802, $"{Utility.FixHtmlFormattable(_guildName)} [{Utility.FixHtmlFormattable(_guildAbbrev)}]");
list.Add(1060802, $"{_guildName.FixHtmlFormattable()} [{_guildAbbrev.FixHtmlFormattable()}]");
}
}

View file

@ -234,7 +234,7 @@ public partial class Key : Item
return;
}
_key.Description = Utility.FixHtml(text);
_key.Description = text.FixHtml();
}
}

View file

@ -245,7 +245,7 @@ public partial class WeaponEngravingTool : Item, IUsesRemaining, IRewardItem
else
{
_target.EngravedText =
Utility.FixHtml(relay.Length > 64 ? relay[..64] : relay);
(relay.Length > 64 ? relay[..64] : relay).FixHtml();
state.Mobile.SendLocalizedMessage(1072361); // You engraved the object.
_target.InvalidateProperties();
_tool.UsesRemaining -= 1;

View file

@ -519,7 +519,7 @@ namespace Server.Mobiles
}
else
{
vi.Description = Utility.FixHtml(vi.Description);
vi.Description = vi.Description.FixHtml();
}
}
@ -1451,7 +1451,7 @@ namespace Server.Mobiles
description = text.Trim();
}
SetInfo(from, price, Utility.FixHtml(description));
SetInfo(from, price, description.FixHtml());
}
public override void OnCancel(Mobile from)
@ -1590,7 +1590,7 @@ namespace Server.Mobiles
return;
}
m_Vendor.Name = Utility.FixHtml(name);
m_Vendor.Name = name.FixHtml();
from.SendLocalizedMessage(1062496); // Your vendor has been renamed.
@ -1619,7 +1619,7 @@ namespace Server.Mobiles
return;
}
m_Vendor.ShopName = Utility.FixHtml(name);
m_Vendor.ShopName = name.FixHtml();
from.SendGump(new NewPlayerVendorOwnerGump(m_Vendor));
}

View file

@ -3739,7 +3739,7 @@ namespace Server.Multis
ref ySouth
);
list.Add(1061112, Utility.FixHtml(houseName)); // House Name: ~1_val~
list.Add(1061112, houseName.FixHtml()); // House Name: ~1_val~
list.Add(1061113, owner); // Owner: ~1_val~
if (valid)
{

View file

@ -61,7 +61,7 @@ namespace Server.Multis
{
base.GetProperties(list);
list.Add(1061639, Utility.FixHtml(GetName())); // Name: ~1_NAME~
list.Add(1061639, GetName().FixHtml()); // Name: ~1_NAME~
list.Add(1061640, Owner?.Owner == null ? "nobody" : Owner.Owner.Name); // Owner: ~1_OWNER~
if (Owner != null)