From f1e02b3c0ac12baa0d7ee014fdacd83da98754ac Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 18 Jan 2020 20:38:57 +0000 Subject: Use case insensitive comparisons in getBool. --- src/configparser.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/configparser.cpp') diff --git a/src/configparser.cpp b/src/configparser.cpp index ede5281ee..bcf36a540 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -666,9 +666,10 @@ bool ConfigTag::getBool(const std::string &key, bool def) if(!readString(key, result)) return def; - if (result == "yes" || result == "true" || result == "1" || result == "on") + if (stdalgo::string::equalsci(result, "yes") || stdalgo::string::equalsci(result, "true") || stdalgo::string::equalsci(result, "on") || result == "1") return true; - if (result == "no" || result == "false" || result == "0" || result == "off") + + if (stdalgo::string::equalsci(result, "no") || stdalgo::string::equalsci(result, "false") || stdalgo::string::equalsci(result, "off") || result == "0") return false; ServerInstance->Logs->Log("CONFIG", LOG_DEFAULT, "Value of <" + tag + ":" + key + "> at " + getTagLocation() + -- cgit v1.2.3