mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Mods: use case-insensitive wildcmp() for channel/host matching
Fixes #822
This commit is contained in:
@@ -38,11 +38,11 @@ public:
|
||||
}
|
||||
|
||||
bool IsMatch(const CString& sChan, const CString& sHost, const CString& sMessage) const {
|
||||
if (!sHost.WildCmp(m_sHostmaskWildcard))
|
||||
if (!sHost.WildCmp(m_sHostmaskWildcard, CString::CaseInsensitive))
|
||||
return false;
|
||||
if (!sChan.WildCmp(m_sChannelWildcard))
|
||||
if (!sChan.WildCmp(m_sChannelWildcard, CString::CaseInsensitive))
|
||||
return false;
|
||||
if (!sMessage.WildCmp(m_pModule->ExpandString(m_sSearchWildcard)))
|
||||
if (!sMessage.WildCmp(m_pModule->ExpandString(m_sSearchWildcard), CString::CaseInsensitive))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -206,13 +206,13 @@ protected:
|
||||
|
||||
bool IsAutoCycle(const CString& sChan) {
|
||||
for (unsigned int a = 0; a < m_vsNegChans.size(); a++) {
|
||||
if (sChan.WildCmp(m_vsNegChans[a])) {
|
||||
if (sChan.WildCmp(m_vsNegChans[a], CString::CaseInsensitive)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (unsigned int b = 0; b < m_vsChans.size(); b++) {
|
||||
if (sChan.WildCmp(m_vsChans[b])) {
|
||||
if (sChan.WildCmp(m_vsChans[b], CString::CaseInsensitive)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
|
||||
bool ChannelMatches(const CString& sChan) const {
|
||||
for (set<CString>::const_iterator it = m_ssChans.begin(); it != m_ssChans.end(); ++it) {
|
||||
if (sChan.AsLower().WildCmp(*it)) {
|
||||
if (sChan.AsLower().WildCmp(*it, CString::CaseInsensitive)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
|
||||
bool HostMatches(const CString& sHostmask) {
|
||||
for (set<CString>::const_iterator it = m_ssHostmasks.begin(); it != m_ssHostmasks.end(); ++it) {
|
||||
if (sHostmask.WildCmp(*it)) {
|
||||
if (sHostmask.WildCmp(*it, CString::CaseInsensitive)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
|
||||
bool ChannelMatches(const CString& sChan) const {
|
||||
for (set<CString>::const_iterator it = m_ssChans.begin(); it != m_ssChans.end(); ++it) {
|
||||
if (sChan.AsLower().WildCmp(*it)) {
|
||||
if (sChan.AsLower().WildCmp(*it, CString::CaseInsensitive)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
}
|
||||
|
||||
bool HostMatches(const CString& sHostmask) {
|
||||
return sHostmask.WildCmp(m_sHostmask);
|
||||
return sHostmask.WildCmp(m_sHostmask, CString::CaseInsensitive);
|
||||
}
|
||||
|
||||
CString GetChannels() const {
|
||||
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
void SetEnabled(bool bEnabled) { m_bEnabled = bEnabled; }
|
||||
|
||||
bool Compare(const CString& sTarget) const {
|
||||
return sTarget.WildCmp(m_sRule);
|
||||
return sTarget.WildCmp(m_sRule, CString::CaseInsensitive);
|
||||
}
|
||||
|
||||
bool operator==(const CLogRule& sOther) const {
|
||||
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
for (unsigned int a = 0; a < m_vsSources.size(); a++) {
|
||||
const CWatchSource& WatchSource = m_vsSources[a];
|
||||
|
||||
if (sSource.AsLower().WildCmp(WatchSource.GetSource().AsLower())) {
|
||||
if (sSource.WildCmp(WatchSource.GetSource(), CString::CaseInsensitive)) {
|
||||
if (WatchSource.IsNegated()) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -93,9 +93,9 @@ public:
|
||||
|
||||
if (!bGoodSource)
|
||||
return false;
|
||||
if (!Nick.GetHostMask().AsLower().WildCmp(m_sHostMask.AsLower()))
|
||||
if (!Nick.GetHostMask().WildCmp(m_sHostMask, CString::CaseInsensitive))
|
||||
return false;
|
||||
return (sText.AsLower().WildCmp(pNetwork->ExpandString(m_sPattern).AsLower()));
|
||||
return (sText.WildCmp(pNetwork->ExpandString(m_sPattern), CString::CaseInsensitive));
|
||||
}
|
||||
|
||||
bool operator ==(const CWatchEntry& WatchEntry) {
|
||||
|
||||
Reference in New Issue
Block a user