mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Fix font file validation (#2982)
This commit is contained in:
parent
d4d4636e8d
commit
0b15b62e3d
@ -43,7 +43,8 @@ namespace Bloxstrap.UI.ViewModels.Settings
|
|||||||
|
|
||||||
string type = dialog.FileName.Substring(dialog.FileName.Length-3, 3).ToLowerInvariant();
|
string type = dialog.FileName.Substring(dialog.FileName.Length-3, 3).ToLowerInvariant();
|
||||||
|
|
||||||
if (!FontHeaders.ContainsKey(type) || !File.ReadAllBytes(dialog.FileName).Take(4).SequenceEqual(FontHeaders[type]))
|
if (!FontHeaders.ContainsKey(type)
|
||||||
|
|| !FontHeaders.Any(x => File.ReadAllBytes(dialog.FileName).Take(4).SequenceEqual(x.Value)))
|
||||||
{
|
{
|
||||||
Frontend.ShowMessageBox(Strings.Menu_Mods_Misc_CustomFont_Invalid, MessageBoxImage.Error);
|
Frontend.ShowMessageBox(Strings.Menu_Mods_Misc_CustomFont_Invalid, MessageBoxImage.Error);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user