From 58d61539c3b6f8b30306c9f5f73549fa9ec491c5 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Thu, 6 Sep 2012 19:11:00 +0700 Subject: [PATCH] webadmin: Fix using empty value for defaults in user page for buffer size. Thanks to p3k for finding it. --- modules/webadmin.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/webadmin.cpp b/modules/webadmin.cpp index ac3f2d83..5292b7d4 100644 --- a/modules/webadmin.cpp +++ b/modules/webadmin.cpp @@ -247,10 +247,14 @@ public: pNewUser->SetDCCBindHost(pUser->GetDCCBindHost()); } - // First apply the old limit in case the new one is too high - if (pUser) - pNewUser->SetBufferCount(pUser->GetBufferCount(), true); - pNewUser->SetBufferCount(WebSock.GetParam("bufsize").ToUInt(), spSession->IsAdmin()); + sArg = WebSock.GetParam("bufsize"); if (!sArg.empty()) pNewUser->SetBufferCount(sArg.ToUInt(), spSession->IsAdmin()); + if (!sArg.empty()) { + // First apply the old limit in case the new one is too high + if (pUser) + pNewUser->SetBufferCount(pUser->GetBufferCount(), true); + pNewUser->SetBufferCount(sArg.ToUInt(), spSession->IsAdmin()); + } + pNewUser->SetSkinName(WebSock.GetParam("skin")); pNewUser->SetAutoClearChanBuffer(WebSock.GetParam("autoclearchanbuffer").ToBool()); pNewUser->SetMultiClients(WebSock.GetParam("multiclients").ToBool());