Improve URL filtering in url.php

Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
Michal Čihař 2016-07-18 16:39:25 +02:00
parent 714818f3ad
commit e8c5cab3c1

View File

@ -818,6 +818,10 @@ if(! function_exists('hash_equals')) {
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 */