Skip to content

Commit cdc5824

Browse files
committed
Parsed down the URL parameter which earlier allowed XSS on page
1 parent 3679557 commit cdc5824

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)