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 ...@@ -37,6 +37,7 @@ class MetaGer
protected $canCache = false; protected $canCache = false;
# Daten über die Abfrage$ # Daten über die Abfrage$
protected $ip; protected $ip;
protected $useragent;
protected $language; protected $language;
protected $agent; protected $agent;
protected $apiKey = ""; protected $apiKey = "";
...@@ -912,6 +913,8 @@ class MetaGer ...@@ -912,6 +913,8 @@ class MetaGer
# nicht einmal wir selbst noch Zugriff auf die Daten haben: # 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->ip = preg_replace("/(\d+)\.(\d+)\.\d+.\d+/s", "$1.$2.0.0", $this->ip);
$this->useragent = $request->header('User-Agent');
# Language # Language
if (isset($_SERVER['HTTP_LANGUAGE'])) { if (isset($_SERVER['HTTP_LANGUAGE'])) {
$this->language = $_SERVER['HTTP_LANGUAGE']; $this->language = $_SERVER['HTTP_LANGUAGE'];
...@@ -1439,6 +1442,11 @@ class MetaGer ...@@ -1439,6 +1442,11 @@ class MetaGer
{ {
return $this->ip; return $this->ip;
} }
public function getUserAgent()
{
return $this->useragent;
}
public function getEingabe() public function getEingabe()
{ {
......
...@@ -69,7 +69,7 @@ abstract class Searchengine ...@@ -69,7 +69,7 @@ abstract class Searchengine
return; 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->ip = $metager->getIp();
$this->gefVon = "<a href=\"" . $this->homepage . "\" target=\"_blank\" rel=\"noopener\">" . $this->displayName . "</a>"; $this->gefVon = "<a href=\"" . $this->homepage . "\" target=\"_blank\" rel=\"noopener\">" . $this->displayName . "</a>";
$this->startTime = microtime(); $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