mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-06 11:58:38 +00:00
Protect call to ParseBase64Image
This commit is contained in:
parent
d078afd99a
commit
aafdaf19fd
1 changed files with 5 additions and 7 deletions
|
@ -39,15 +39,13 @@ public class UserSettingsPage : BaseLayout
|
||||||
|
|
||||||
if (!this.User.IsModerator && this.User != this.ProfileUser) return this.Redirect("~/user/" + userId);
|
if (!this.User.IsModerator && this.User != this.ProfileUser) return this.Redirect("~/user/" + userId);
|
||||||
|
|
||||||
|
// Deny request if in read-only mode
|
||||||
|
if (avatar != null && ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode)
|
||||||
|
return this.Redirect($"~/user/{userId}");
|
||||||
|
|
||||||
string? avatarHash = await FileHelper.ParseBase64Image(avatar);
|
string? avatarHash = await FileHelper.ParseBase64Image(avatar);
|
||||||
|
|
||||||
if (avatarHash != null)
|
if (avatarHash != null) this.ProfileUser.IconHash = avatarHash;
|
||||||
{
|
|
||||||
// Deny request if in read-only mode
|
|
||||||
if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.Redirect($"~/user/{userId}");
|
|
||||||
|
|
||||||
this.ProfileUser.IconHash = avatarHash;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.User.IsAdmin) this.ProfileUser.ProfileTag = profileTag;
|
if (this.User.IsAdmin) this.ProfileUser.ProfileTag = profileTag;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue