From c7307242620af48e0078a932974f8eb2db49adac Mon Sep 17 00:00:00 2001 From: Taarly Date: Wed, 7 May 2025 12:06:29 +0200 Subject: [PATCH] email sanitizition fixed to check for "@" and "." --- Project.Controller/InputSanitizer.cs | 2 +- Project.Persistence/SQLite2.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Project.Controller/InputSanitizer.cs b/Project.Controller/InputSanitizer.cs index 823133e..17b0aa1 100644 --- a/Project.Controller/InputSanitizer.cs +++ b/Project.Controller/InputSanitizer.cs @@ -12,7 +12,7 @@ public partial class InputSanitizer public static bool MasterLoginEmailBool(string email) { if (string.IsNullOrEmpty(email)) return false; - if (email.Contains('@') && email.Length > 6) return true; + if (email.Contains('@') && email.Contains('.')) return true; else return false; } //MasterLogin - Name Check diff --git a/Project.Persistence/SQLite2.cs b/Project.Persistence/SQLite2.cs index 8789802..e310d83 100644 --- a/Project.Persistence/SQLite2.cs +++ b/Project.Persistence/SQLite2.cs @@ -11,8 +11,10 @@ public partial class SQLite connection.Open(); using (var command = connection.CreateCommand()) { + command.Parameters.AddWithValue("@loginname", username); + command.Parameters.AddWithValue("@loginpass", password); command.CommandText = - @" + @"SELECT * FROM TABLE ( LOGINS ) WHERE loginname = @loginname "; } }