Ensure links from setup go through url.php

Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
Michal Čihař 2016-05-23 09:40:17 +02:00
parent b061096abd
commit 5fc8020c5b
2 changed files with 9 additions and 4 deletions

View File

@ -724,7 +724,7 @@ function PMA_arrayRemove($path, &$array)
*/
function PMA_linkURL($url)
{
if (!preg_match('#^https?://#', $url) || defined('PMA_SETUP')) {
if (!preg_match('#^https?://#', $url)) {
return $url;
}
@ -739,7 +739,12 @@ function PMA_linkURL($url)
$arr = parse_url($url);
parse_str($arr["query"], $vars);
$query = http_build_query(array("url" => $vars["url"]));
$url = './url.php?' . $query;
if (defined('PMA_SETUP')) {
$url = '../url.php?' . $query;
} else {
$url = './url.php?' . $query;
}
return $url;
}

View File

@ -307,8 +307,8 @@ echo PMA_displayFormBottom();
echo '</fieldset>';
echo '<div id="footer">';
echo '<a href="https://www.phpmyadmin.net/">' , __('phpMyAdmin homepage') , '</a>';
echo '<a href="https://www.phpmyadmin.net/donate/">'
echo '<a href="../url.php?url=https://www.phpmyadmin.net/">' , __('phpMyAdmin homepage') , '</a>';
echo '<a href="../url.php?url=https://www.phpmyadmin.net/donate/">'
, __('Donate') , '</a>';
echo '<a href="' , PMA_URL_getCommon() , $separator , 'version_check=1">'
, __('Check for latest version') , '</a>';