Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/MAINT_3_4_1' into QA_3_4
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed May 20, 2011
2 parents 0ea08ee + ecfc8ba commit 1a1e548
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 0 additions & 2 deletions libraries/common.inc.php
Expand Up @@ -477,8 +477,6 @@
'media_type', 'custom_type', 'bs_reference',
/* for changing BLOB repository file MIME type */
'bs_db', 'bs_table', 'bs_ref', 'bs_new_mime_type',
/* URL redirector */
'url'
);
/**
* Require cleanup functions
Expand Down
7 changes: 5 additions & 2 deletions libraries/core.lib.php
Expand Up @@ -681,12 +681,15 @@ function PMA_array_remove($path, &$array)
* @return string URL for a link.
*/
function PMA_linkURL($url) {
$params = array();
$params['url'] = $url;
$goto = 'url.php' . PMA_generate_common_url($params);
if (!preg_match('#^https?://#', $url)) {
return $url;
} elseif (defined('PMA_SETUP')) {
return '../url.php?url=' . $url;
return '../' . $goto;
} else {
return './url.php?url=' . $url;
return './' . $goto;
}
}

Expand Down
6 changes: 2 additions & 4 deletions url.php
Expand Up @@ -3,16 +3,14 @@
* URL redirector to avoid leaking Referer with some sensitive information.
*/

define('PMA_MINIMUM_COMMON', TRUE);

/**
* Gets core libraries and defines some variables
*/
require_once './libraries/common.inc.php';

if (empty($GLOBALS['url']) || ! preg_match('/^https?:\/\/[^\n\r]*$/', $GLOBALS['url'])) {
if (! PMA_isValid($_GET['url']) || ! preg_match('/^https?:\/\/[^\n\r]*$/', $_GET['url'])) {
header('Location: ' . $cfg['PmaAbsoluteUri']);
} else {
header('Location: ' . $GLOBALS['url']);
header('Location: ' . $_GET['url']);
}
?>

0 comments on commit 1a1e548

Please sign in to comment.