1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 23:31:13 -05:00

Sql syntax fix and onelog fix

This commit is contained in:
RaidMax
2015-10-10 18:31:24 -05:00
parent ea1ffeeb4a
commit 04899040fe
9 changed files with 76 additions and 34 deletions

View File

@ -292,6 +292,7 @@ namespace SharedLibrary
//Returns a list of players matching name parameter, null if no players found matching
public List<Player> findPlayers(String name)
{
name = name.Replace("'", "''");
String Query = String.Format("SELECT * FROM CLIENTS WHERE Name LIKE '%{0}%' LIMIT 32", name);
DataTable Result = GetDataTable(Query);

View File

@ -1,4 +1,5 @@
using System;
#define REPZ_BUILD
using System;
using System.Threading;
using System.Text;
using System.Text.RegularExpressions;
@ -45,8 +46,11 @@ namespace SharedLibrary
public static Player.Permission matchPermission(String str)
{
String lookingFor = str.ToLower();
#if REPZ_BUILD
for (Player.Permission Perm = Player.Permission.User; Perm <= Player.Permission.Owner; Perm++)
#else
for (Player.Permission Perm = Player.Permission.User; Perm < Player.Permission.Owner; Perm++)
#endif
{
if (lookingFor.Contains(Perm.ToString().ToLower()))
return Perm;
@ -58,7 +62,7 @@ namespace SharedLibrary
public static String removeNastyChars(String str)
{
if (str != null)
return str.Replace("`", "").Replace("\\", "").Replace("\"", "").Replace("&quot;", "''").Replace("&amp;", "&").Replace("\"", "''");
return str.Replace("`", "").Replace("\\", "").Replace("\"", "").Replace("&quot;", "").Replace("&amp;", "&").Replace("\"", "''").Replace("'", "");
else
return String.Empty;
}