mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Merge pull request #693 from jpnurmi/tags
Valueless & escaped message tags
This commit is contained in:
@@ -38,21 +38,23 @@ protected:
|
||||
}
|
||||
|
||||
void testString(const CString& in, const CString& url,
|
||||
const CString& html, const CString& sql) {
|
||||
const CString& html, const CString& sql, const CString& tag) {
|
||||
SCOPED_TRACE("String: " + in);
|
||||
|
||||
testEncode(in, url, "URL");
|
||||
testEncode(in, html, "HTML");
|
||||
testEncode(in, sql, "SQL");
|
||||
testEncode(in, tag, "MSGTAG");
|
||||
}
|
||||
};
|
||||
|
||||
TEST_F(EscapeTest, Test) {
|
||||
// input url html sql
|
||||
testString("abcdefg", "abcdefg", "abcdefg", "abcdefg");
|
||||
testString("\n\t\r", "%0A%09%0D", "\n\t\r", "\\n\\t\\r");
|
||||
testString("'\"", "%27%22", "'"", "\\'\\\"");
|
||||
testString("&<>", "%26%3C%3E", "&<>", "&<>");
|
||||
// input url html sql msgtag
|
||||
testString("abcdefg","abcdefg", "abcdefg", "abcdefg", "abcdefg");
|
||||
testString("\n\t\r", "%0A%09%0D", "\n\t\r", "\\n\\t\\r", "\\n\t\\r");
|
||||
testString("'\"", "%27%22", "'"", "\\'\\\"", "'\"");
|
||||
testString("&<>", "%26%3C%3E", "&<>", "&<>", "&<>");
|
||||
testString(" ;", "+%3B", " ;", " ;", "\\s\\:");
|
||||
}
|
||||
|
||||
TEST(StringTest, Bool) {
|
||||
|
||||
Reference in New Issue
Block a user