From 6cec602c5c135b94c871c673671e4317184d5b6d Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 6 Sep 2017 14:37:58 +0200 Subject: [PATCH] Added event support in `UserOnline::getBrowser()` --- .../files/lib/data/user/online/UserOnline.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wcfsetup/install/files/lib/data/user/online/UserOnline.class.php b/wcfsetup/install/files/lib/data/user/online/UserOnline.class.php index c14588f5f8..43f6070f90 100644 --- a/wcfsetup/install/files/lib/data/user/online/UserOnline.class.php +++ b/wcfsetup/install/files/lib/data/user/online/UserOnline.class.php @@ -4,6 +4,7 @@ use wcf\data\page\PageCache; use wcf\data\spider\Spider; use wcf\data\user\UserProfile; use wcf\system\cache\builder\SpiderCacheBuilder; +use wcf\system\event\EventHandler; use wcf\system\page\handler\IOnlineLocationPageHandler; use wcf\system\WCF; use wcf\util\StringUtil; @@ -124,6 +125,12 @@ class UserOnline extends UserProfile { * @return string */ public function getBrowser() { + $parameters = ['browser' => '', 'userAgent' => $this->userAgent]; + EventHandler::getInstance()->fireAction($this, 'getBrowser', $parameters); + if (!empty($parameters['browser'])) { + return $parameters['browser']; + } + // lunascape if (preg_match('~lunascape[ /]([\d\.]+)~i', $this->userAgent, $match)) { return 'Lunascape '.$match[1]; -- 2.20.1