Commit 7a38a9bd authored by Dominik Hebeler's avatar Dominik Hebeler

Merge branch 'useragent-fix' into 'development'

Useragent fix

See merge request !1167
parents 666f5af3 0dceb063
......@@ -37,6 +37,7 @@ class MetaGer
protected $canCache = false;
# Daten über die Abfrage$
protected $ip;
protected $useragent;
protected $language;
protected $agent;
protected $apiKey = "";
......@@ -912,6 +913,8 @@ class MetaGer
# nicht einmal wir selbst noch Zugriff auf die Daten haben:
$this->ip = preg_replace("/(\d+)\.(\d+)\.\d+.\d+/s", "$1.$2.0.0", $this->ip);
$this->useragent = $request->header('User-Agent');
# Language
if (isset($_SERVER['HTTP_LANGUAGE'])) {
$this->language = $_SERVER['HTTP_LANGUAGE'];
......@@ -1440,6 +1443,11 @@ class MetaGer
return $this->ip;
}
public function getUserAgent()
{
return $this->useragent;
}
public function getEingabe()
{
return $this->eingabe;
......
......@@ -69,7 +69,7 @@ abstract class Searchengine
return;
}
$this->useragent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1";
$this->useragent = $metager->getUserAgent();
$this->ip = $metager->getIp();
$this->gefVon = "<a href=\"" . $this->homepage . "\" target=\"_blank\" rel=\"noopener\">" . $this->displayName . "</a>";
$this->startTime = microtime();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment