Changeset c2e697f in github


Ignore:
Timestamp:
Sep 24, 2009 9:50:31 AM (4 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
7d51781
Parents:
38bf4253
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/include/rcube_browser.php

    r23a2eec rc2e697f  
    4444        $this->ie  = stristr($HTTP_USER_AGENT, 'compatible; msie') && !$this->opera; 
    4545        $this->mz  = stristr($HTTP_USER_AGENT, 'mozilla/5'); 
     46        $this->chrome = stristr($HTTP_USER_AGENT, 'chrome'); 
    4647        $this->khtml = stristr($HTTP_USER_AGENT, 'khtml'); 
    4748        $this->safari = ($this->khtml || stristr($HTTP_USER_AGENT, 'safari')); 
    4849 
    49         if ($this->ns) { 
    50             $test = preg_match('/mozilla\/([0-9.]+)/i', $HTTP_USER_AGENT, $regs); 
    51             $this->ver = $test ? (float)$regs[1] : 0; 
     50        if ($this->ns || $this->chrome) { 
     51            $test = preg_match('/(mozilla|chrome)\/([0-9.]+)/i', $HTTP_USER_AGENT, $regs); 
     52            $this->ver = $test ? (float)$regs[2] : 0; 
    5253        } 
    53         if ($this->mz) { 
     54        else if ($this->mz) { 
    5455            $test = preg_match('/rv:([0-9.]+)/', $HTTP_USER_AGENT, $regs); 
    5556            $this->ver = $test ? (float)$regs[1] : 0; 
    5657        } 
    57         if($this->ie) { 
    58             $test = preg_match('/msie ([0-9.]+)/i', $HTTP_USER_AGENT, $regs); 
    59             $this->ver = $test ? (float)$regs[1] : 0; 
    60         } 
    61         if ($this->opera) { 
    62             $test = preg_match('/opera ([0-9.]+)/i', $HTTP_USER_AGENT, $regs); 
    63             $this->ver = $test ? (float)$regs[1] : 0; 
     58        else if ($this->ie || $this->opera) { 
     59            $test = preg_match('/(msie|opera) ([0-9.]+)/i', $HTTP_USER_AGENT, $regs); 
     60            $this->ver = $test ? (float)$regs[2] : 0; 
    6461        } 
    6562 
Note: See TracChangeset for help on using the changeset viewer.