mirror of
https://github.com/znc/znc.git
synced 2026-07-04 00:41:38 +02:00
Merge branch 'htmlstring'
This commit is contained in:
+4
-4
@@ -294,13 +294,13 @@ CString CString::Escape_n(EEscape eFrom, EEscape eTo) const {
|
||||
}
|
||||
|
||||
if (ch == 0) {
|
||||
if (!strncasecmp((const char*)&pTmp, "<", 2))
|
||||
if (!strncasecmp((const char*)&pTmp, "<", 4))
|
||||
ch = '<';
|
||||
else if (!strncasecmp((const char*)&pTmp, ">", 2))
|
||||
else if (!strncasecmp((const char*)&pTmp, ">", 4))
|
||||
ch = '>';
|
||||
else if (!strncasecmp((const char*)&pTmp, """, 4))
|
||||
else if (!strncasecmp((const char*)&pTmp, """, 6))
|
||||
ch = '"';
|
||||
else if (!strncasecmp((const char*)&pTmp, "&", 3))
|
||||
else if (!strncasecmp((const char*)&pTmp, "&", 5))
|
||||
ch = '&';
|
||||
}
|
||||
|
||||
|
||||
+4
-2
@@ -53,6 +53,8 @@ TEST_F(EscapeTest, Test) {
|
||||
testString("&<>", "%26%3C%3E", "&<>", "&<>", "&<>");
|
||||
testString(" ;", "+%3B", " ;", " ;", "\\s\\:");
|
||||
// clang-format on
|
||||
EXPECT_EQ(CString("a<.b>c").Escape_n(CString::EHTML, CString::EASCII),
|
||||
"a<.b>c");
|
||||
}
|
||||
|
||||
TEST(StringTest, Bool) {
|
||||
@@ -199,8 +201,8 @@ TEST(StringTest, Equals) {
|
||||
|
||||
TEST(StringTest, Find) {
|
||||
EXPECT_EQ(CString("Hello, I'm Bob").Find("Hello"), 0u);
|
||||
EXPECT_EQ(
|
||||
CString("Hello, I'm Bob").Find("Hello", CString::CaseInsensitive), 0u);
|
||||
EXPECT_EQ(CString("Hello, I'm Bob").Find("Hello", CString::CaseInsensitive),
|
||||
0u);
|
||||
EXPECT_EQ(CString("Hello, I'm Bob").Find("Hello", CString::CaseSensitive),
|
||||
0u);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user