function _simpleads_is_valid_referer in SimpleAds 7.2
Check HTTP referer and make sure this is a local action
2 calls to _simpleads_is_valid_referer()
- simpleads_node_stats_count_clicks in ./
simpleads.pages.inc - Count clicks.
- simpleads_node_stats_count_impressions in ./
simpleads.pages.inc - Count impressions.
File
- includes/
helper.inc, line 316 - Helper functions.
Code
function _simpleads_is_valid_referer() {
$server = !empty($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_ENV['HOSTNAME'];
if (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], $server) !== FALSE) {
return TRUE;
}
else {
return FALSE;
}
}