diff options
| author | 2006-12-29 21:27:39 +0000 | |
|---|---|---|
| committer | 2006-12-29 21:27:39 +0000 | |
| commit | b848ca14335adcb924acb7977d93e0d76b9437b7 (patch) | |
| tree | b02af028dfcaea81fff788f6982bf08f7e863c8d /src/modules/m_dnsbl.cpp | |
| parent | A few fixes, but i cant see why the reverse check doesnt work (diff) | |
Fixed search and replace, code pilfered from m_alias (i think someone misread the help for std::string::replace...)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6162 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_dnsbl.cpp')
| -rw-r--r-- | src/modules/m_dnsbl.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index 351ef688f..03b691ece 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -94,11 +94,12 @@ class DNSBLResolver : public Resolver if (bitmask != 0) { std::string reason = ConfEntry->reason; - - std::string::size_type pos; - while ((pos = reason.find("%ip%")) != std::string::npos) + std::string::size_type x = reason.find("%ip%"); + while (x != std::string::npos) { - reason.replace(pos, 4, them->GetIPString()); + reason.erase(x, 4); + reason.insert(x, "%ip%"); + x = reason.find("%ip%"); } ServerInstance->WriteOpers("*** Connecting user %s detected as being on a DNS blacklist (%s) with result %d", them->GetFullRealHost(), ConfEntry->name.c_str(), bitmask); |
