[security] Redirect external links to avoid Referer leakage.
This commit is contained in:
18
url.php
Normal file
18
url.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* URL redirector to avoid leaking Referer with some sensitive information.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Gets core libraries and defines some variables
|
||||
*/
|
||||
require_once './libraries/common.inc.php';
|
||||
|
||||
PMA_checkParameters(array('url'));
|
||||
|
||||
if (! preg_match('/^https?:\/\/[^\n\r]*$/', $GLOBALS['url'])) {
|
||||
header('Location: ' . $cfg['PmaAbsoluteUri']);
|
||||
} else {
|
||||
header('Location: ' . $GLOBALS['url']);
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user