Skip to content

Commit

Permalink
More tests and better test visualizations.
Browse files Browse the repository at this point in the history
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@5712 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
amyreese committed Oct 22, 2008
1 parent 278a7a6 commit 5e5d200
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/test_string_sanitize_url.php
Expand Up @@ -36,6 +36,7 @@
$t_test = array(
'',
'abc.php',
'abc.php?',
'abc.php#a',
'abc.php?abc=def',
'abc.php?abc=def#a',
Expand All @@ -45,7 +46,9 @@
'abc.php?abc=def&z=z#<script>alert("foo")</script>a',
'plugin.php?page=Source/index',
'plugin.php?page=Source/list&id=1',
'plugin.php?page=Source/list&id=1#abc',
$my_path.'abc.php',
$my_path.'abc.php?',
$my_path.'abc.php#a',
$my_path.'abc.php?abc=def',
$my_path.'abc.php?abc=def#a',
Expand All @@ -55,13 +58,14 @@
$my_path.'abc.php?abc=def&z=z#<script>alert("foo")</script>a',
$my_path.'plugin.php?page=Source/index',
$my_path.'plugin.php?page=Source/list&id=1',
$my_path.'plugin.php?page=Source/list&id=1#abc',
'http://www.test.my.url/'
);

echo '<tt>';
echo '<pre>';

foreach($t_test as $t_url) {
echo '<br/>' . htmlspecialchars($t_url) . ' => ' . htmlspecialchars(string_sanitize_url($t_url, false)) . "\n";
echo "\n: ", htmlspecialchars($t_url), "\n: ", htmlspecialchars(string_sanitize_url($t_url, false)), "\n";
}

echo '</tt>';
echo '</pre>';

0 comments on commit 5e5d200

Please sign in to comment.