Skip to content

Commit

Permalink
Improve URL filtering in url.php
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Jul 18, 2016
1 parent bf9ad3a commit 88c72dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libraries/core.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,10 @@ function PMA_linkURL($url)
function PMA_isAllowedDomain($url)
{
$arr = parse_url($url);
// Avoid URLs without hostname or with credentials
if (empty($arr['host']) || ! empty($arr['user']) || ! empty($arr['pass'])) {
return false;
}
$domain = $arr["host"];
$domainWhiteList = array(
/* Include current domain */
Expand Down

0 comments on commit 88c72dc

Please sign in to comment.