Changeset 5498 in subversion


Ignore:
Timestamp:
Nov 28, 2011 3:31:42 AM (18 months ago)
Author:
alec
Message:
  • Use strpos() instead of strstr() when possible (#1488211)
Location:
trunk/roundcubemail
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/CHANGELOG

    r5497 r5498  
    22=========================== 
    33 
     4- Use strpos() instead of strstr() when possible (#1488211) 
    45- Fix handling HTML entities when converting HTML to text (#1488212) 
    56- Fix fit_string_to_size() renders browser and ui unresponsive (#1488207) 
  • trunk/roundcubemail/program/include/rcube_browser.php

    r4971 r5498  
    3434 
    3535        $this->ver = 0; 
    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'); 
     36        $this->win = strpos($HTTP_USER_AGENT, 'win') != false; 
     37        $this->mac = strpos($HTTP_USER_AGENT, 'mac') != false; 
     38        $this->linux = strpos($HTTP_USER_AGENT, 'linux') != false; 
     39        $this->unix  = strpos($HTTP_USER_AGENT, 'unix') != false; 
    4040 
    41         $this->opera = strstr($HTTP_USER_AGENT, 'opera'); 
    42         $this->ns4 = strstr($HTTP_USER_AGENT, 'mozilla/4') && !stristr($HTTP_USER_AGENT, 'msie'); 
    43         $this->ns  = ($this->ns4 || strstr($HTTP_USER_AGENT, 'netscape')); 
    44         $this->ie  = !$this->opera && stristr($HTTP_USER_AGENT, 'compatible; msie'); 
    45         $this->mz  = !$this->ie && 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')); 
     41        $this->opera = strpos($HTTP_USER_AGENT, 'opera') !== false; 
     42        $this->ns4 = strpos($HTTP_USER_AGENT, 'mozilla/4') !== false && strpos($HTTP_USER_AGENT, 'msie') === false; 
     43        $this->ns  = ($this->ns4 || strpos($HTTP_USER_AGENT, 'netscape') !== false); 
     44        $this->ie  = !$this->opera && strpos($HTTP_USER_AGENT, 'compatible; msie') !== false; 
     45        $this->mz  = !$this->ie && strpos($HTTP_USER_AGENT, 'mozilla/5') !== false; 
     46        $this->chrome = strpos($HTTP_USER_AGENT, 'chrome') !== false; 
     47        $this->khtml = strpos($HTTP_USER_AGENT, 'khtml') !== false; 
     48        $this->safari = !$this->chrome && ($this->khtml || strpos($HTTP_USER_AGENT, 'safari') !== false); 
    4949 
    5050        if ($this->ns || $this->chrome) { 
  • trunk/roundcubemail/program/include/rcube_smtp.php

    r5485 r5498  
    391391 
    392392        // Reject envelope From: addresses with spaces. 
    393         if (strstr($from, ' ')) 
     393        if (strpos($from, ' ') !== false) 
    394394          return false; 
    395395 
Note: See TracChangeset for help on using the changeset viewer.