[security] Redirect external links to avoid Referer leakage.
This commit is contained in:
@@ -91,10 +91,14 @@ function PMA_lang_link_replace($link, $text)
|
||||
$separator = PMA_get_arg_separator('html');
|
||||
}
|
||||
|
||||
if (!preg_match('#^http://#', $link)) {
|
||||
if (!preg_match('#^https?://#', $link)) {
|
||||
$link = str_replace('&', $separator, $link);
|
||||
} elseif (defined('PMA_SETUP')) {
|
||||
$link = '../url.php?url=' . $link;
|
||||
} else {
|
||||
$link = './url.php?url=' . $link;
|
||||
}
|
||||
|
||||
return '<a href="' . $link . '">' . $text . '</a>';
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
Reference in New Issue
Block a user