2012-02-14 Miguel de Dios <miguel.dedios@artica.es>

* include/functions.php: fixed function "check_refererer" when the http
	server run in other port instead the normally 80 port.
	
	Fixes: #3452474



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5591 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-02-14 12:35:07 +00:00
parent d64617aa5b
commit f94a0cbd2b
2 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2012-02-14 Miguel de Dios <miguel.dedios@artica.es>
* include/functions.php: fixed function "check_refererer" when the http
server run in other port instead the normally 80 port.
Fixes: #3452474
2012-02-14 Sancho Lerena <slerena@artica.es>
* include/config_process.php: updated build & version.

View File

@ -67,7 +67,13 @@ function check_refererer() {
if ($config['https']) {
$url = 'https://';
}
//Check if the referer have a port (for example when apache run in other port to 80)
if (preg_match('/http(s?):\/\/.*:[0-9]*/', $referer) == 1) {
$url .= $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $config["homeurl"];
}
else {
$url .= $_SERVER['SERVER_NAME'] . $config["homeurl"];
}
if (strpos($referer, $url) === 0) {
return true;