mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-09-27 03:39:11 +00:00
Fix doubly sanitized strings (#727)
* Add migration to de-sanitize database strings * Remove SanitizationHelper functions related to XML sanitization * Remove sanitization usage from website * Implement suggested changes
This commit is contained in:
parent
f5c8f53437
commit
50d1d9c7e5
12 changed files with 26 additions and 66 deletions
|
@ -68,8 +68,6 @@ public class SlotPageController : ControllerBase
|
|||
return this.Redirect("~/slot/" + id);
|
||||
}
|
||||
|
||||
// Prevent potential xml injection and censor content
|
||||
msg = SanitizationHelper.SanitizeString(msg);
|
||||
msg = CensorHelper.FilterMessage(msg);
|
||||
|
||||
bool success = await this.database.PostComment(token.UserId, id, CommentType.Level, msg);
|
||||
|
|
|
@ -44,8 +44,6 @@ public class UserPageController : ControllerBase
|
|||
return this.Redirect("~/user/" + id);
|
||||
}
|
||||
|
||||
// Prevent potential xml injection and censor content
|
||||
msg = SanitizationHelper.SanitizeString(msg);
|
||||
msg = CensorHelper.FilterMessage(msg);
|
||||
|
||||
bool success = await this.database.PostComment(token.UserId, id, CommentType.Profile, msg);
|
||||
|
|
|
@ -29,15 +29,13 @@ public class SlotSettingsPage : BaseLayout
|
|||
|
||||
if (avatarHash != null) this.Slot.IconHash = avatarHash;
|
||||
|
||||
name = SanitizationHelper.SanitizeString(name);
|
||||
name = CensorHelper.FilterMessage(name);
|
||||
if (this.Slot.Name != name && name.Length <= 64) this.Slot.Name = name;
|
||||
|
||||
description = SanitizationHelper.SanitizeString(description);
|
||||
description = CensorHelper.FilterMessage(description);
|
||||
if (this.Slot.Description != description && description.Length <= 512) this.Slot.Description = description;
|
||||
|
||||
labels = LabelHelper.RemoveInvalidLabels(SanitizationHelper.SanitizeString(labels));
|
||||
labels = LabelHelper.RemoveInvalidLabels(labels);
|
||||
if (this.Slot.AuthorLabels != labels) this.Slot.AuthorLabels = labels;
|
||||
|
||||
// ReSharper disable once InvertIf
|
||||
|
|
|
@ -33,7 +33,6 @@ public class UserSettingsPage : BaseLayout
|
|||
|
||||
if (avatarHash != null) this.ProfileUser.IconHash = avatarHash;
|
||||
|
||||
biography = SanitizationHelper.SanitizeString(biography);
|
||||
biography = CensorHelper.FilterMessage(biography);
|
||||
|
||||
if (this.ProfileUser.Biography != biography && biography.Length <= 512) this.ProfileUser.Biography = biography;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue