diff --git a/Database/Database-Geographies.cs b/Database/Database-Geographies.cs index 18055d56..723f08f6 100644 --- a/Database/Database-Geographies.cs +++ b/Database/Database-Geographies.cs @@ -284,8 +284,7 @@ namespace Swarmops.Database DbCommand command = GetDbCommand ( - "SELECT " + geographyFieldSequence + " WHERE Name like '" + geographyName.Replace ("'", "''") + - "%'", + "SELECT " + geographyFieldSequence + " WHERE Name ='" + geographyName.Replace ("'", "''") + "'", connection); using (DbDataReader reader = command.ExecuteReader()) diff --git a/Logic/Cache/GeographyCache.cs b/Logic/Cache/GeographyCache.cs index 87023b88..19128a60 100644 --- a/Logic/Cache/GeographyCache.cs +++ b/Logic/Cache/GeographyCache.cs @@ -228,7 +228,7 @@ namespace Swarmops.Logic.Cache Dictionary> hashedGeographies = GetHashedGeographies(); foreach (int entry in hashedGeographies.Keys) { - if (hashedGeographies[entry][0].Name.ToLower().Trim().StartsWith (cmpName)) + if (hashedGeographies[entry][0].Name.ToLower().Trim() == cmpName) return hashedGeographies[entry][0]; } //TODO: This can miss due to that the geography was added after last cache reload