From: Naffanya Date: Fri, 31 Jan 2014 15:44:31 +0000 (+0200) Subject: Correcting case insensitive search X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/cf7325e6b3244c7174424fa71e1972523324a69b Correcting case insensitive search --- diff --git a/projects/stargazer/user_impl.cpp b/projects/stargazer/user_impl.cpp index 25bfe526..f6dd38f1 100644 --- a/projects/stargazer/user_impl.cpp +++ b/projects/stargazer/user_impl.cpp @@ -1511,17 +1511,18 @@ while (it != messages.end()) //----------------------------------------------------------------------------- std::string USER_IMPL::GetParamValue(const std::string & name) const { - if (ToLower(name) == "id") + std::string lowerName = ToLower(name); + if (lowerName == "id") { std::ostringstream stream; stream << id; return stream.str(); } - 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); + if (lowerName == "login") return login; + if (lowerName == "currip") return currIP.ToString(); + if (lowerName == "enableddirs") return GetEnabledDirs(); + if (property.Exists(lowerName)) + return property.GetPropertyValue(lowerName); else { WriteServLog("User’s parameter '%s' does not exist.", name.c_str());