[security] Redirect external links to avoid Referer leakage.

This commit is contained in:
Michal Čihař
2011-01-28 13:13:22 +01:00
parent 87b0c30747
commit dc0c6938b2
15 changed files with 60 additions and 31 deletions

View File

@@ -681,7 +681,7 @@ class FormDisplay
if ($test == 'Export') {
$opt_name = substr($opt_name, 7);
}
return 'http://wiki.phpmyadmin.net/pma/Config#' . $opt_name;
return './url.php?url=http://wiki.phpmyadmin.net/pma/Config#' . $opt_name;
}
/**
@@ -774,4 +774,4 @@ class FormDisplay
}
}
}
?>
?>

View File

@@ -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>';
}
?>
?>