diff --git a/app/MetaGer.php b/app/MetaGer.php index 82e02058cb1362e983991cd054f9f9b686cf14dd..48f5b5f949dd647f25ed63fa5cc4ecca51e2b033 100644 --- a/app/MetaGer.php +++ b/app/MetaGer.php @@ -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']; @@ -1439,6 +1442,11 @@ class MetaGer { return $this->ip; } + + public function getUserAgent() + { + return $this->useragent; + } public function getEingabe() { diff --git a/app/Models/Searchengine.php b/app/Models/Searchengine.php index a27553479eef6524983575b5ad77f6d67e3a43c5..b3f0e06c791cf69ce48f975540ebfaaefee9316c 100644 --- a/app/Models/Searchengine.php +++ b/app/Models/Searchengine.php @@ -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();