diff options
author | Sadie Powell <sadie@witchery.services> | 2023-12-17 13:46:34 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2023-12-17 13:46:34 +0000 |
commit | eb0e5c89b2a1e59091001ffd0e54582c2ff04212 (patch) | |
tree | 6caad8512fd05dd74a890edf0e8658731b4e63c2 | |
parent | 84c2f8d3fc417e97ed336c48b8a5c4eea71b52aa (diff) |
Remove the m_regex_pcre module.
Users should migrate to m_regex_pcre2 instead.
-rw-r--r-- | .github/workflows/ci-linux.yml | 3 | ||||
-rw-r--r-- | data/modules.example.conf | 10 | ||||
-rw-r--r-- | docs/Changes.conf | 4 | ||||
-rw-r--r-- | modules/extra/m_regex_pcre.cpp | 78 |
4 files changed, 4 insertions, 91 deletions
diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 1794ededf..ba196936d 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -21,14 +21,13 @@ jobs: libldap2-dev \ libmysqlclient-dev \ libpcre2-dev \ - libpcre3-dev \ libsqlite3-dev \ libssl-dev \ libtre-dev \ ninja-build - name: Enable extras run: | - for MODULE in m_ldap.cpp m_ldap_authentication.cpp m_ldap_oper.cpp m_mysql.cpp m_regex_pcre.cpp m_regex_pcre2.cpp m_regex_posix.cpp m_regex_tre.cpp m_sql_authentication.cpp m_sql_log.cpp m_sql_oper.cpp m_sqlite.cpp m_ssl_gnutls.cpp m_ssl_openssl.cpp stats + for MODULE in m_ldap.cpp m_ldap_authentication.cpp m_ldap_oper.cpp m_mysql.cpp m_regex_pcre2.cpp m_regex_posix.cpp m_regex_tre.cpp m_sql_authentication.cpp m_sql_log.cpp m_sql_oper.cpp m_sqlite.cpp m_ssl_gnutls.cpp m_ssl_openssl.cpp stats do ln -s ${{ github.workspace }}/modules/extra/$MODULE ${{ github.workspace }}/modules done diff --git a/data/modules.example.conf b/data/modules.example.conf index f06789e41..6076c254a 100644 --- a/data/modules.example.conf +++ b/data/modules.example.conf @@ -401,18 +401,10 @@ module { name = "help" } } /* - * m_regex_pcre [EXTRA] - * - * Provides the regex engine regex/pcre, which uses version 1 of the Perl Compatible Regular - * Expressions library. This can not be loaded at the same time as the m_regex_pcre2 module. - */ -#module { name = "m_regex_pcre" } - -/* * m_regex_pcre2 [EXTRA] * * Provides the regex engine regex/pcre, which uses version 2 of the Perl Compatible Regular - * Expressions library. This can not be loaded at the same time as the m_regex_pcre module. + * Expressions library. #module { name = "m_regex_pcre2" } /* diff --git a/docs/Changes.conf b/docs/Changes.conf index fdfa09982..fdd729b04 100644 --- a/docs/Changes.conf +++ b/docs/Changes.conf @@ -1,6 +1,6 @@ Anope Version 2.1.1-git ----------------------- -No significant changes. +Removed the m_regex_pcre module (use m_regex_pcre2 instead). Anope Version 2.1.0 ------------------- @@ -9,7 +9,7 @@ Removed nickserv:strictpasswords as it is obsolete now nickserv:minpasslen exist Removed the inspircd12 and inspircd20 modules (use inspircd instead). Removed the ns_getpass module (no supported encryption modules). Removed the os_oline module (no supported IRCds). -Removed the unreal module (use unrealircd instead) +Removed the unreal module (use unrealircd instead). Renamed nickserv:passlen to nickserv:maxpasslen. Renamed the charybdis module to solanum. Renamed the inspircd3 module to inspircd. diff --git a/modules/extra/m_regex_pcre.cpp b/modules/extra/m_regex_pcre.cpp deleted file mode 100644 index 8fd18bebe..000000000 --- a/modules/extra/m_regex_pcre.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * - * (C) 2012-2023 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - */ - -/* RequiredLibraries: pcre */ -/* RequiredWindowsLibraries: libpcre */ - -#include "module.h" -#include <pcre.h> - -class PCRERegex : public Regex -{ - pcre *regex; - - public: - PCRERegex(const Anope::string &expr) : Regex(expr) - { - const char *error; - int erroffset; - this->regex = pcre_compile(expr.c_str(), PCRE_CASELESS, &error, &erroffset, NULL); - if (!this->regex) - throw RegexException("Error in regex " + expr + " at offset " + stringify(erroffset) + ": " + error); - } - - ~PCRERegex() - { - pcre_free(this->regex); - } - - bool Matches(const Anope::string &str) - { - return pcre_exec(this->regex, NULL, str.c_str(), str.length(), 0, 0, NULL, 0) > -1; - } -}; - -class PCRERegexProvider : public RegexProvider -{ - public: - PCRERegexProvider(Module *creator) : RegexProvider(creator, "regex/pcre") { } - - Regex *Compile(const Anope::string &expression) override - { - return new PCRERegex(expression); - } -}; - -class ModuleRegexPCRE : public Module -{ - PCRERegexProvider pcre_regex_provider; - - public: - ModuleRegexPCRE(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, EXTRA | VENDOR), - pcre_regex_provider(this) - { - this->SetPermanent(true); - } - - ~ModuleRegexPCRE() - { - for (auto *xlm : XLineManager::XLineManagers) - { - for (auto *x : xlm->GetList()) - { - if (x->regex && dynamic_cast<PCRERegex *>(x->regex)) - { - delete x->regex; - x->regex = NULL; - } - } - } - } -}; - -MODULE_INIT(ModuleRegexPCRE) |