Skip to content

Commit df96135

Browse files
committed
Merge pull request #107 from mehulmpt/master
Parsed down the URL parameter which earlier allowed XSS on page
2 parents 3679557 + cdc5824 commit df96135

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

demo/index.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66

77
function get($name, $default = '')
88
{
9+
if($name == 'url') {
10+
if(filter_var($_GET['url'], FILTER_VALIDATE_URL)) {
11+
return 'http://doNotTryToXSS.invalid';
12+
}
13+
}
914
return isset($_GET[$name]) ? $_GET[$name] : $default;
1015
}
1116

0 commit comments

Comments
 (0)