mirror of
https://github.com/znc/znc.git
synced 2026-04-30 18:42:25 +02:00
Fix CString::Escape_n() and add some tests for it
This bug was originally reported by someone on irc, but sadly I forgot who it was. Sorry! Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
@@ -212,10 +212,10 @@ CString CString::Escape_n(EEscape eFrom, EEscape eTo) const {
|
||||
}
|
||||
|
||||
if (ch == 0) {
|
||||
if (!strncasecmp((const char*) &pTmp, "lt", 2)) ch = '<';
|
||||
else if (!strncasecmp((const char*) &pTmp, "gt", 2)) ch = '>';
|
||||
else if (!strncasecmp((const char*) &pTmp, "quot", 4)) ch = '"';
|
||||
else if (!strncasecmp((const char*) &pTmp, "amp", 3)) ch = '&';
|
||||
if (!strncasecmp((const char*) &pTmp, "<", 2)) ch = '<';
|
||||
else if (!strncasecmp((const char*) &pTmp, ">", 2)) ch = '>';
|
||||
else if (!strncasecmp((const char*) &pTmp, """, 4)) ch = '"';
|
||||
else if (!strncasecmp((const char*) &pTmp, "&", 3)) ch = '&';
|
||||
}
|
||||
|
||||
if (ch > 0) {
|
||||
|
||||
Reference in New Issue
Block a user