Update files to use global $referrerurl variable
If possible, capture the referring URL to use in links to static website pages. This way when coming from a distributed HPR website and not hackerpublicradio.com, clicking on a page link will return you to the original domain.
This commit is contained in:
@@ -20,4 +20,14 @@ $naughty_stings_file = '/path/to/strings.txt';
|
||||
$justification_file = '/path/to/justification.txt';
|
||||
# Read more: http://vidiame.com/php/how-to-block-multiple-ip-addresses-using-php
|
||||
|
||||
# The $referrerurl is used for links to pages from the orginating HPR site.
|
||||
$referrerurl = $baseurl;
|
||||
session_start();
|
||||
if ($_SESSION['referrerurl']) {
|
||||
$referrerurl = $_SESSION['referrerurl'];
|
||||
}
|
||||
else if ($_SERVER["HTTP_REFERER"] && !str_starts_with($_SERVER["HTTP_REFERER"], $hubBaseurl)) {
|
||||
$_SESSION['referrerurl'] = $_SERVER["HTTP_REFERER"];
|
||||
$referrerurl = $_SERVER["HTTP_REFERER"];
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user