Changeset 3946 in subversion for trunk/roundcubemail/program/include/rcube_browser.php
- Timestamp:
- Sep 8, 2010 5:40:39 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/rcube_browser.php
r3942 r3946 31 31 function __construct() 32 32 { 33 $HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];33 $HTTP_USER_AGENT = strtolower($_SERVER['HTTP_USER_AGENT']); 34 34 35 35 $this->ver = 0; 36 $this->win = str istr($HTTP_USER_AGENT, 'win');37 $this->mac = str istr($HTTP_USER_AGENT, 'mac');38 $this->linux = str istr($HTTP_USER_AGENT, 'linux');39 $this->unix = str istr($HTTP_USER_AGENT, 'unix');36 $this->win = strstr($HTTP_USER_AGENT, 'win'); 37 $this->mac = strstr($HTTP_USER_AGENT, 'mac'); 38 $this->linux = strstr($HTTP_USER_AGENT, 'linux'); 39 $this->unix = strstr($HTTP_USER_AGENT, 'unix'); 40 40 41 $this->opera = str istr($HTTP_USER_AGENT, 'opera');42 $this->ns4 = str istr($HTTP_USER_AGENT, 'mozilla/4') && !stristr($HTTP_USER_AGENT, 'msie');43 $this->ns = ($this->ns4 || str istr($HTTP_USER_AGENT, 'netscape'));44 $this->ie = stristr($HTTP_USER_AGENT, 'compatible; msie') && !$this->opera;45 $this->mz = str istr($HTTP_USER_AGENT, 'mozilla/5');46 $this->chrome = str istr($HTTP_USER_AGENT, 'chrome');47 $this->khtml = str istr($HTTP_USER_AGENT, 'khtml');48 $this->safari = !$this->chrome && ($this->khtml || str istr($HTTP_USER_AGENT, 'safari'));41 $this->opera = strstr($HTTP_USER_AGENT, 'opera'); 42 $this->ns4 = strstr($HTTP_USER_AGENT, 'mozilla/4') && !strstr($HTTP_USER_AGENT, 'msie'); 43 $this->ns = ($this->ns4 || strstr($HTTP_USER_AGENT, 'netscape')); 44 $this->ie = !$this->opera && strstr($HTTP_USER_AGENT, 'compatible; msie'); 45 $this->mz = strstr($HTTP_USER_AGENT, 'mozilla/5'); 46 $this->chrome = strstr($HTTP_USER_AGENT, 'chrome'); 47 $this->khtml = strstr($HTTP_USER_AGENT, 'khtml'); 48 $this->safari = !$this->chrome && ($this->khtml || strstr($HTTP_USER_AGENT, 'safari')); 49 49 50 50 if ($this->ns || $this->chrome) { 51 $test = preg_match('/(mozilla|chrome)\/([0-9.]+)/ i', $HTTP_USER_AGENT, $regs);51 $test = preg_match('/(mozilla|chrome)\/([0-9.]+)/', $HTTP_USER_AGENT, $regs); 52 52 $this->ver = $test ? (float)$regs[2] : 0; 53 53 } … … 57 57 } 58 58 else if ($this->ie || $this->opera) { 59 $test = preg_match('/(msie|opera) ([0-9.]+)/ i', $HTTP_USER_AGENT, $regs);59 $test = preg_match('/(msie|opera) ([0-9.]+)/', $HTTP_USER_AGENT, $regs); 60 60 $this->ver = $test ? (float)$regs[2] : 0; 61 61 } 62 62 63 if (preg_match('/ ([a-z]{2})-([a-z]{2})/ i', $HTTP_USER_AGENT, $regs))63 if (preg_match('/ ([a-z]{2})-([a-z]{2})/', $HTTP_USER_AGENT, $regs)) 64 64 $this->lang = $regs[1]; 65 65 else
Note: See TracChangeset
for help on using the changeset viewer.
