source = $source; } /** * detect the useragent * * @return string */ public function getUserAgent() : string { $userAgent = ''; foreach ($this->userAgentHeaders as $header) { if (array_key_exists($header, $this->source) && $this->source[$header] ) { $userAgent = $this->cleanParam($this->source[$header]); break; } } return $userAgent; } /** * clean Parameters taken from GET or POST Variables * * @param string $param the value to be cleaned * * @return string */ private function cleanParam(string $param) : string { return strip_tags(trim(urldecode($param))); } }