mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-19 03:31:29 +00:00
Prevent null values from being censored
This commit is contained in:
parent
89556d5dfa
commit
d6788f0965
2 changed files with 24 additions and 9 deletions
|
@ -29,14 +29,26 @@ public class SlotSettingsPage : BaseLayout
|
||||||
|
|
||||||
if (avatarHash != null) this.Slot.IconHash = avatarHash;
|
if (avatarHash != null) this.Slot.IconHash = avatarHash;
|
||||||
|
|
||||||
|
if (name != null)
|
||||||
|
{
|
||||||
name = CensorHelper.FilterMessage(name);
|
name = CensorHelper.FilterMessage(name);
|
||||||
if (this.Slot.Name != name && name.Length <= 64) this.Slot.Name = name;
|
if (this.Slot.Name != name && name.Length <= 64)
|
||||||
|
this.Slot.Name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (description != null)
|
||||||
|
{
|
||||||
description = CensorHelper.FilterMessage(description);
|
description = CensorHelper.FilterMessage(description);
|
||||||
if (this.Slot.Description != description && description.Length <= 512) this.Slot.Description = description;
|
if (this.Slot.Description != description && description?.Length <= 512)
|
||||||
|
this.Slot.Description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (labels != null)
|
||||||
|
{
|
||||||
labels = LabelHelper.RemoveInvalidLabels(labels);
|
labels = LabelHelper.RemoveInvalidLabels(labels);
|
||||||
if (this.Slot.AuthorLabels != labels) this.Slot.AuthorLabels = labels;
|
if (this.Slot.AuthorLabels != labels)
|
||||||
|
this.Slot.AuthorLabels = labels;
|
||||||
|
}
|
||||||
|
|
||||||
// ReSharper disable once InvertIf
|
// ReSharper disable once InvertIf
|
||||||
if (this.Database.ChangeTracker.HasChanges())
|
if (this.Database.ChangeTracker.HasChanges())
|
||||||
|
|
|
@ -33,9 +33,12 @@ public class UserSettingsPage : BaseLayout
|
||||||
|
|
||||||
if (avatarHash != null) this.ProfileUser.IconHash = avatarHash;
|
if (avatarHash != null) this.ProfileUser.IconHash = avatarHash;
|
||||||
|
|
||||||
|
if (biography != null)
|
||||||
|
{
|
||||||
biography = CensorHelper.FilterMessage(biography);
|
biography = CensorHelper.FilterMessage(biography);
|
||||||
|
if (this.ProfileUser.Biography != biography && biography.Length <= 512)
|
||||||
if (this.ProfileUser.Biography != biography && biography.Length <= 512) this.ProfileUser.Biography = biography;
|
this.ProfileUser.Biography = biography;
|
||||||
|
}
|
||||||
|
|
||||||
if (ServerConfiguration.Instance.Mail.MailEnabled &&
|
if (ServerConfiguration.Instance.Mail.MailEnabled &&
|
||||||
SanitizationHelper.IsValidEmail(email) &&
|
SanitizationHelper.IsValidEmail(email) &&
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue