Changeset 1161 for trunk/UnitTestContrib/test/unit/Fn_URLPARAM.pm
- Timestamp:
- 12/04/08 07:48:32 (3 years ago)
- File:
-
- 1 edited
-
trunk/UnitTestContrib/test/unit/Fn_URLPARAM.pm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/UnitTestContrib/test/unit/Fn_URLPARAM.pm
r816 r1161 55 55 '%URLPARAM{"foo" default="bar"}%', $this->{test_web}, $this->{test_topic}); 56 56 $this->assert_str_equals('', "$str"); 57 58 $this->{request}->param( -name=>'foo', -value=>'<evil script>\'\"%'); 59 $str = $this->{twiki}->handleCommonTags( 60 '%URLPARAM{"foo" default="bar"}%', $this->{test_web}, $this->{test_topic}); 61 $this->assert_str_equals('<evil script>'\"%', "$str"); 57 62 } 58 63 … … 62 67 my $str; 63 68 64 $this->{request}->param( -name=>'foo', -value=>' &?*!"');69 $this->{request}->param( -name=>'foo', -value=>'<>\'%&?*!"'); 65 70 $str = $this->{twiki}->handleCommonTags( 66 71 '%URLPARAM{"foo" encode="entity"}%', $this->{test_web}, $this->{test_topic}); 67 $this->assert_str_equals('&# 38;?*!"', "$str");72 $this->assert_str_equals('<>'%&?*!"', "$str"); 68 73 69 74 $this->{request}->param( -name=>'foo', -value=>'&?*!" '); … … 76 81 '%URLPARAM{"foo" encode="quote"}%', $this->{test_web}, $this->{test_topic}); 77 82 $this->assert_str_equals('&?*!\" ', "$str"); 83 84 $this->{request}->param( -name=>'foo', -value=>'<evil script>\'\"%'); 85 $str = $this->{twiki}->handleCommonTags( 86 '%URLPARAM{"foo" default="bar" encode="safe"}%', $this->{test_web}, $this->{test_topic}); 87 $this->assert_str_equals('<evil script>'\"%', "$str"); 88 89 $this->{request}->param( -name=>'foo', -value=>'<evil script>\'\"%'); 90 $str = $this->{twiki}->handleCommonTags( 91 '%URLPARAM{"foo" default="bar" encode="off"}%', $this->{test_web}, $this->{test_topic}); 92 $this->assert_str_equals('<evil script>\'\"%', "$str"); 93 94 $this->{request}->param( -name=>'foo', -value=>'<evil script>\'\"%'); 95 $str = $this->{twiki}->handleCommonTags( 96 '%URLPARAM{"foo" default="bar" encode="none"}%', $this->{test_web}, $this->{test_topic}); 97 $this->assert_str_equals('<evil script>\'\"%', "$str"); 78 98 } 79 99
Note: See TracChangeset
for help on using the changeset viewer.
