Fixed browser (Opera) detection
authorMarcel Werk <burntime@woltlab.com>
Wed, 18 Sep 2013 12:42:23 +0000 (14:42 +0200)
committerMarcel Werk <burntime@woltlab.com>
Wed, 18 Sep 2013 12:42:23 +0000 (14:42 +0200)
wcfsetup/install/files/lib/data/user/online/UserOnline.class.php

index 56f9e8f546b956773fb9ad6ce10ef96d2aa9eb3e..595176c1f2f0998dcaac0cc0db7c65df799d07c4 100644 (file)
@@ -85,11 +85,16 @@ class UserOnline extends UserProfile {
         * @return      string
         */
        public function getBrowser() {
-               // opera
+               // opera 12
                if (preg_match('~opera.*version/([\d\.]+)~i', $this->userAgent, $match)) {
                        return 'Opera '.$match[1];
                }
                
+               // opera 15+
+               if (preg_match('~opr/([\d\.]+)~i', $this->userAgent, $match)) {
+                       return 'Opera '.$match[1];
+               }
+               
                // firefox
                if (preg_match('~firefox/([\d\.]+)~i', $this->userAgent, $match)) {
                        return 'Firefox '.$match[1];