summaryrefslogtreecommitdiff
path: root/modules/webcpanel/pages/chanserv/modes.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-08-24 16:39:04 -0400
committerAdam <Adam@anope.org>2014-08-24 16:39:04 -0400
commitbf8f62c32d6c66e38c167e6ca0ac59d29db52326 (patch)
treeffdd06b244fcd38eca5956c7f9143f76ddcaaf5e /modules/webcpanel/pages/chanserv/modes.cpp
parentd417241a5b87e1e717755aa851ba0977857db873 (diff)
Change Channel::GetModeList to return a copy of the mode list, not a
pair of lower/upper bound iterators. Sometimes when iterating the list, like in cs_mode, we can modify the contents of it, which combined with mlock always agressively trying to readd modes to it can do bad things.
Diffstat (limited to 'modules/webcpanel/pages/chanserv/modes.cpp')
-rw-r--r--modules/webcpanel/pages/chanserv/modes.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/webcpanel/pages/chanserv/modes.cpp b/modules/webcpanel/pages/chanserv/modes.cpp
index d5b111708..e01239f58 100644
--- a/modules/webcpanel/pages/chanserv/modes.cpp
+++ b/modules/webcpanel/pages/chanserv/modes.cpp
@@ -94,9 +94,9 @@ bool WebCPanel::ChanServ::Modes::OnRequest(HTTPProvider *server, const Anope::st
WebPanel::RunCommand(na->nc->display, na->nc, "ChanServ", "chanserv/mode", params, replacements);
}
- std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> ml = c->GetModeList(cm->name);
- for (; ml.first != ml.second; ++ml.first)
- replacements["MASKS"] = HTTPUtils::Escape(ml.first->second);
+ std::vector<Anope::string> v = c->GetModeList(cm->name);
+ for (unsigned int i = 0; i < v.size(); ++i)
+ replacements["MASKS"] = HTTPUtils::Escape(v[i]);
}
Page.Serve(server, page_name, client, message, reply, replacements);