Skip to content

Commit

Permalink
Ensure links from setup go through 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 May 23, 2016
1 parent b061096 commit 5fc8020
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions libraries/core.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions setup/frames/index.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@

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>';
Expand Down

0 comments on commit 5fc8020

Please sign in to comment.