private function RadioactivityIncident::getSource in Radioactivity 7.2
Figure out the source of this incident MUST work without Drupal boostrap also
1 call to RadioactivityIncident::getSource()
File
- includes/
RadioactivityIncident.inc, line 35 - Incident class
Class
- RadioactivityIncident
- @file Incident class
Code
private function getSource() {
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
self::$source_cache = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
else {
self::$source_cache = $_SERVER['REMOTE_ADDR'];
}
if (isset($_SERVER['HTTP_USER_AGENT'])) {
self::$source_cache .= $_SERVER['HTTP_USER_AGENT'];
}
$hash = $this->entityType . $this->bundle . $this->fieldName . $this->language . $this->entityId;
$source = md5(self::$source_cache . $hash);
return $source;
}