summaryrefslogtreecommitdiff
path: root/modules/extra/m_xmlrpc.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-09-16 06:28:48 -0400
committerAdam <Adam@anope.org>2013-09-16 06:47:42 -0400
commite3c05efe5e5085f3db14f1532a92de460b899ab5 (patch)
treea486474c1eff7e04a7167c1d069d23a93406e171 /modules/extra/m_xmlrpc.cpp
parent8cbaf7e9904e3cc6aca22566c83ea25959357d48 (diff)
Remove static variables from functions in modules which causes them to be marked as gnu unique objects, which breaks dlclose()/dlopen() on g++ 4.5+
Diffstat (limited to 'modules/extra/m_xmlrpc.cpp')
-rw-r--r--modules/extra/m_xmlrpc.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/modules/extra/m_xmlrpc.cpp b/modules/extra/m_xmlrpc.cpp
index 3c16f997e..36401b800 100644
--- a/modules/extra/m_xmlrpc.cpp
+++ b/modules/extra/m_xmlrpc.cpp
@@ -3,6 +3,28 @@
#include "modules/xmlrpc.h"
#include "modules/httpd.h"
+static struct special_chars
+{
+ Anope::string character;
+ Anope::string replace;
+
+ special_chars(const Anope::string &c, const Anope::string &r) : character(c), replace(r) { }
+}
+special[] = {
+ special_chars("&", "&amp;"),
+ special_chars("\"", "&quot;"),
+ special_chars("<", "&lt;"),
+ special_chars(">", "&qt;"),
+ special_chars("'", "&#39;"),
+ special_chars("\n", "&#xA;"),
+ special_chars("\002", ""), // bold
+ special_chars("\003", ""), // color
+ special_chars("\035", ""), // italics
+ special_chars("\037", ""), // underline
+ special_chars("\026", ""), // reverses
+ special_chars("", "")
+};
+
class MyXMLRPCServiceInterface : public XMLRPCServiceInterface, public HTTPPage
{
std::deque<XMLRPCEvent *> events;
@@ -25,28 +47,6 @@ class MyXMLRPCServiceInterface : public XMLRPCServiceInterface, public HTTPPage
Anope::string Sanitize(const Anope::string &string) anope_override
{
- static struct special_chars
- {
- Anope::string character;
- Anope::string replace;
-
- special_chars(const Anope::string &c, const Anope::string &r) : character(c), replace(r) { }
- }
- special[] = {
- special_chars("&", "&amp;"),
- special_chars("\"", "&quot;"),
- special_chars("<", "&lt;"),
- special_chars(">", "&qt;"),
- special_chars("'", "&#39;"),
- special_chars("\n", "&#xA;"),
- special_chars("\002", ""), // bold
- special_chars("\003", ""), // color
- special_chars("\035", ""), // italics
- special_chars("\037", ""), // underline
- special_chars("\026", ""), // reverses
- special_chars("", "")
- };
-
Anope::string ret = string;
for (int i = 0; special[i].character.empty() == false; ++i)
ret = ret.replace_all_cs(special[i].character, special[i].replace);