We now trim all leading and trailing spaces from parameter values passed

into webadmin/webmods. This makes sense in almost every case, be it that
users accidentally hit the space bar or try to outsmart ZNC by entering
nothing but spaces into a textbox.
By doing the latter, it was possible to trick ZNC into not starting up
again. Thanks to Redirect_ for bringing this to our attention. Another
commit that will fix the underlying problem while writing to the config
file will follow.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1961 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
cflakes
2010-05-01 18:36:05 +00:00
parent 084988a307
commit bb567c51de
+3
View File
@@ -325,6 +325,7 @@ CString CHTTPSock::GetParam(const CString& sName, bool bPost, const CString& sFi
CString CHTTPSock::GetParam(const CString& sName, const map<CString, VCString>& msvsParams, const CString& sFilter) {
CString sRet = GetRawParam(sName, msvsParams);
sRet.Trim();
for (size_t i = 0; i < sFilter.length(); i++) {
sRet.Replace(CString(sFilter.at(i)), "");
@@ -347,6 +348,7 @@ unsigned int CHTTPSock::GetParamValues(const CString& sName, set<CString>& ssRet
if (it != msvsParams.end()) {
for (unsigned int a = 0; a < it->second.size(); a++) {
CString sParam = it->second[a];
sParam.Trim();
for (size_t i = 0; i < sFilter.length(); i++) {
sParam.Replace(CString(sFilter.at(i)), "");
@@ -372,6 +374,7 @@ unsigned int CHTTPSock::GetParamValues(const CString& sName, VCString& vsRet, co
if (it != msvsParams.end()) {
for (unsigned int a = 0; a < it->second.size(); a++) {
CString sParam = it->second[a];
sParam.Trim();
for (size_t i = 0; i < sFilter.length(); i++) {
sParam.Replace(CString(sFilter.at(i)), "");