Skip to content

Commit bc771d1

Browse files
committed
Use the image hack name instead of the index
It make easier to know what is failing.
1 parent afa451a commit bc771d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/sanitizer_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,8 @@ def test_should_not_fall_for_xss_image_hack_with_uppercase_tags
326326
%(<IMG SRC="jav&#x0D;ascript:alert('XSS');">),
327327
%(<IMG SRC=" &#14; javascript:alert('XSS');">),
328328
%(<IMG SRC="javascript&#x3a;alert('XSS');">),
329-
%(<IMG SRC=`javascript:alert("RSnake says, 'XSS'")`>)].each_with_index do |img_hack, i|
330-
define_method "test_should_not_fall_for_xss_image_hack_#{i+1}" do
329+
%(<IMG SRC=`javascript:alert("RSnake says, 'XSS'")`>)].each do |img_hack|
330+
define_method "test_should_not_fall_for_xss_image_hack_#{img_hack}" do
331331
assert_sanitized img_hack, "<img>"
332332
end
333333
end

0 commit comments

Comments
 (0)