Add UserAgent::getUserAgent()
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 25 Feb 2021 09:04:15 +0000 (10:04 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 25 Feb 2021 09:04:56 +0000 (10:04 +0100)
wcfsetup/install/files/lib/util/UserAgent.class.php

index b54cd6740e9aebe82db019fc57025364a5e2924c..00e424e284d597ab34e948fc31d887d9217576f6 100644 (file)
@@ -401,6 +401,22 @@ class UserAgent
         }
     }
 
+    /**
+     * Returns the raw user agent string.
+     */
+    public function getUserAgent(): string
+    {
+        return $this->userAgent;
+    }
+
+    /**
+     * @see UserAgent::getUserAgent()
+     */
+    public function __toString(): string
+    {
+        return $this->getUserAgent();
+    }
+
     /**
      * Returns the browser based on the user agent or null, if no browser can be determined.
      */