From 0f3d949bbd04f332ea1370f0d1c50b8515619aaa Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 11 Jul 2024 12:50:31 +0100 Subject: [PATCH] Add URL encoded versions of the DNSBL/network to the dnsbl module. --- docs/conf/providers/dronebl.example.conf | 2 +- src/modules/m_dnsbl.cpp | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/conf/providers/dronebl.example.conf b/docs/conf/providers/dronebl.example.conf index bc744314a..c865d9742 100644 --- a/docs/conf/providers/dronebl.example.conf +++ b/docs/conf/providers/dronebl.example.conf @@ -8,4 +8,4 @@ records="3,5,6,7,8,9,10,11,13,14,15,16,17,19" action="zline" duration="7d" - reason="You are listed in DroneBL. Please visit https://dronebl.org/lookup.do?ip=%ip%&network=%network% for more information."> + reason="You are listed in DroneBL. Please visit https://dronebl.org/lookup.do?ip=%ip%&network=%network.url% for more information."> diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index c0aa4aa21..ac6666626 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -366,10 +366,12 @@ public: if (match) { const std::string reason = Template::Replace(config->reason, { - { "dnsbl", config->name }, - { "ip", them->GetAddress() }, - { "network", ServerInstance->Config->Network }, - { "result", ConvToStr(result) }, + { "dnsbl", config->name }, + { "dnsbl.url", Percent::Encode(config->name) }, + { "ip", them->GetAddress() }, + { "network", ServerInstance->Config->Network }, + { "network.url", Percent::Encode(ServerInstance->Config->Network) }, + { "result", ConvToStr(result) }, }); config->stats_hits++;