Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

webadmin: Fix using empty value for defaults in user page for buffer …

…size.

Thanks to p3k for finding it.
  • Loading branch information...
commit 58d61539c3b6f8b30306c9f5f73549fa9ec491c5 1 parent c4f7290
@DarthGandalf DarthGandalf authored
Showing with 8 additions and 4 deletions.
  1. +8 −4 modules/webadmin.cpp
View
12 modules/webadmin.cpp
@@ -247,10 +247,14 @@ class CWebAdminMod : public CModule {
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());
Please sign in to comment.
Something went wrong with that request. Please try again.