diff options
author | Sadie Powell <sadie@witchery.services> | 2020-01-18 20:38:57 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2020-01-18 20:39:12 +0000 |
commit | f1e02b3c0ac12baa0d7ee014fdacd83da98754ac (patch) | |
tree | be4536ca746bc6cdb11725f21b0c033d0f97e3e6 | |
parent | 87471ab92dc4c0089d021db3faa27ed2f929fb6b (diff) |
Use case insensitive comparisons in getBool.
-rw-r--r-- | src/configparser.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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() + |