From: Alexander Ebert Date: Wed, 6 Sep 2017 12:37:58 +0000 (+0200) Subject: Added event support in `UserOnline::getBrowser()` X-Git-Tag: 3.1.0_Alpha_3~9 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6cec602c5c135b94c871c673671e4317184d5b6d;p=GitHub%2FWoltLab%2FWCF.git Added event support in `UserOnline::getBrowser()` --- 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];