mirror of
https://github.com/anope/anope.git
synced 2026-07-03 22:03:14 +02:00
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+
This commit is contained in:
+22
-22
@@ -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("&", "&"),
|
||||
special_chars("\"", """),
|
||||
special_chars("<", "<"),
|
||||
special_chars(">", "&qt;"),
|
||||
special_chars("'", "'"),
|
||||
special_chars("\n", "
"),
|
||||
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("&", "&"),
|
||||
special_chars("\"", """),
|
||||
special_chars("<", "<"),
|
||||
special_chars(">", "&qt;"),
|
||||
special_chars("'", "'"),
|
||||
special_chars("\n", "
"),
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user