mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-05 19:38:39 +00:00
Fix missing filtering, filter inconsistencies, and filter logging (#1082)
* Fix missing filtering, filter inconsistencies, and filter logging * Remove unused import and replace removed logger * Make filter log arguments optional * Update ProjectLighthouse.Servers.GameServer/Controllers/MessageController.cs Co-authored-by: sudokoko <sudo@koko.rip> * Update ProjectLighthouse.Servers.Website/Pages/Debug/FilterTestPage.cshtml.cs Co-authored-by: sudokoko <sudo@koko.rip> * Replace filter location strings with enum * Rename enum to FilterLocation for readability --------- Co-authored-by: sudokoko <sudo@koko.rip>
This commit is contained in:
parent
a3022ff5b4
commit
f059b20489
13 changed files with 59 additions and 38 deletions
|
@ -7,6 +7,7 @@ using LBPUnion.ProjectLighthouse.Helpers;
|
|||
using LBPUnion.ProjectLighthouse.Localization;
|
||||
using LBPUnion.ProjectLighthouse.Servers.Website.Pages.Layouts;
|
||||
using LBPUnion.ProjectLighthouse.Types.Entities.Profile;
|
||||
using LBPUnion.ProjectLighthouse.Types.Filter;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
|
@ -55,9 +56,12 @@ public class UserSettingsPage : BaseLayout
|
|||
if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode)
|
||||
return this.Redirect($"~/user/{userId}");
|
||||
|
||||
biography = CensorHelper.FilterMessage(biography);
|
||||
if (this.ProfileUser.Biography != biography && biography.Length <= 512)
|
||||
this.ProfileUser.Biography = biography;
|
||||
{
|
||||
string filteredBio = CensorHelper.FilterMessage(biography, FilterLocation.UserBiography, this.ProfileUser.Username);
|
||||
|
||||
this.ProfileUser.Biography = filteredBio;
|
||||
}
|
||||
}
|
||||
|
||||
if (ServerConfiguration.Instance.Mail.MailEnabled &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue