'), '
')
assert_equal(HtmlSanitizer.strict('
test'), '
test')
assert_equal(HtmlSanitizer.strict('
test'), '
test')
assert_equal(HtmlSanitizer.strict('
test', true), 'https://some/path (
test)')
assert_equal(HtmlSanitizer.strict('
'), '
')
assert_equal(HtmlSanitizer.strict('
'), '')
assert_equal(HtmlSanitizer.strict('
+ADw-SCRIPT+AD4-alert(\'XSS\');+ADw-/SCRIPT+AD4-'), ' +ADw-SCRIPT+AD4-alert(\'XSS\');+ADw-/SCRIPT+AD4-')
assert_equal(HtmlSanitizer.strict(''), '')
assert_equal(HtmlSanitizer.strict('
XSS'), '
XSS')
assert_equal(HtmlSanitizer.strict('
XSS', true), 'h%0Att%20%20p://6%206.000146.0x7.147/ (
XSS)')
assert_equal(HtmlSanitizer.strict('
XSS'), '
XSS')
assert_equal(HtmlSanitizer.strict('
XSS', true), '//www.google.com/ (
XSS)')
assert_equal(HtmlSanitizer.strict('
'), 'X')
assert_equal(HtmlSanitizer.strict('
CLICKME'), 'CLICKME')
assert_equal(HtmlSanitizer.strict('
CLICKME'), '
CLICKME')
assert_equal(HtmlSanitizer.strict('
CLICKME', true), 'CLICKME')
assert_equal(HtmlSanitizer.strict('
'), '
')
assert_equal(HtmlSanitizer.strict('
'), '
')
assert_equal(HtmlSanitizer.strict('
'), '')
assert_equal(HtmlSanitizer.strict('
'), '')
assert_equal(HtmlSanitizer.strict(''), '')
assert_equal(HtmlSanitizer.strict(''), '')
assert_equal(HtmlSanitizer.strict(''), '')
assert_equal(HtmlSanitizer.strict('XXX'), 'XXX')
assert_equal(HtmlSanitizer.strict('XXX', true), 'XXX')
assert_equal(HtmlSanitizer.strict(''), 'alert(1)')
assert_equal(HtmlSanitizer.strict(''), '')
assert_equal(HtmlSanitizer.strict('', true), 'http://example.com')
end
end