Skip to content

Commit f30ce58

Browse files
committed
trying to fix encoded urls
1 parent cbc8be8 commit f30ce58

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

demo/index.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ function get($name, $default = '')
1111
}
1212

1313
if ($name === 'url') {
14-
if (!filter_var($_GET['url'], FILTER_VALIDATE_URL)) {
14+
$url = urldecode($_GET['url']);
15+
16+
if (!filter_var($url, FILTER_VALIDATE_URL)) {
1517
return 'http://doNotTryToXSS.invalid';
1618
}
1719

18-
return urldecode($_GET['url']);
20+
return $url;
1921
}
2022

2123
return $_GET[$name];

0 commit comments

Comments
 (0)