Contao\Environment::httpUserAgent PHP Method

httpUserAgent() protected static method

Return the user agent as string
protected static httpUserAgent ( ) : string
return string The user agent string
    protected static function httpUserAgent()
    {
        $ua = strip_tags($_SERVER['HTTP_USER_AGENT']);
        $ua = preg_replace('/javascript|vbscri?pt|script|applet|alert|document|write|cookie/i', '', $ua);
        return substr($ua, 0, 255);
    }