From: Naffanya Date: Thu, 30 Jan 2014 19:57:13 +0000 (+0200) Subject: Correcting case insensitive search X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/624f31fdf2c7726745dbfc53b7a16be6ff715023?ds=inline Correcting case insensitive search --- diff --git a/include/stg/user_property.h b/include/stg/user_property.h index 398c4579..f2421213 100644 --- a/include/stg/user_property.h +++ b/include/stg/user_property.h @@ -392,7 +392,7 @@ else inline std::string USER_PROPERTIES::GetPropertyValue(const std::string & name) const { -std::map::const_iterator it = properties.find(name); +std::map::const_iterator it = properties.find(ToLower(name)); if (it == properties.end()) return ""; return it->second->ToString(); @@ -401,7 +401,7 @@ return it->second->ToString(); inline bool USER_PROPERTIES::Exists(const std::string & name) const { -return properties.find(name) != properties.end(); +return properties.find(ToLower(name)) != properties.end(); } //------------------------------------------------------------------------- //------------------------------------------------------------------------- diff --git a/projects/stargazer/user_impl.cpp b/projects/stargazer/user_impl.cpp index 7f6ff352..25bfe526 100644 --- a/projects/stargazer/user_impl.cpp +++ b/projects/stargazer/user_impl.cpp @@ -1511,15 +1511,15 @@ while (it != messages.end()) //----------------------------------------------------------------------------- std::string USER_IMPL::GetParamValue(const std::string & name) const { - if (name == "id") + if (ToLower(name) == "id") { std::ostringstream stream; stream << id; return stream.str(); } - if (name == "login") return login; - if (name == "currIP") return currIP.ToString(); - if (name == "enabledDirs") return GetEnabledDirs(); + if (ToLower(name) == "login") return login; + if (ToLower(name) == "currip") return currIP.ToString(); + if (ToLower(name) == "enableddirs") return GetEnabledDirs(); if (property.Exists(name)) return property.GetPropertyValue(name); else