Changeset ff73e02 in github


Ignore:
Timestamp:
Aug 6, 2008 5:25:45 AM (5 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
2864204
Parents:
f0726b9
Message:
  • fread() replaced by file_get_contents(), see comments in #1484880
Location:
program
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • program/include/rcube_mdb2.php

    r3978ab39 rff73e02  
    567567      return; 
    568568 
    569     $data = ''; 
    570     if ($fd = fopen($file_name, 'r')) 
    571       { 
    572       $data = fread($fd, filesize($file_name)); 
    573       fclose($fd); 
    574       } 
     569    $data = file_get_contents($file_name); 
    575570 
    576571    if (strlen($data)) 
  • program/include/rcube_template.php

    re3e597e rff73e02  
    300300    { 
    301301        $skin_path = $this->config['skin_path']; 
     302        $path = "$skin_path/templates/$name.html"; 
    302303 
    303304        // read template file 
    304         $templ = ''; 
    305         $path = "$skin_path/templates/$name.html"; 
    306  
    307         if (($fp = fopen($path, 'r')) === false) { 
    308             $message = ''; 
     305        if (($templ = file_get_contents($path)) === false) { 
    309306            ob_start(); 
    310             fopen($path, 'r'); 
    311             $message.= ob_get_contents(); 
     307            file_get_contents($path); 
     308            $message = ob_get_contents(); 
    312309            ob_end_clean(); 
    313310            raise_error(array( 
     
    320317            return false; 
    321318        } 
    322         $templ = fread($fp, filesize($path)); 
    323         fclose($fp); 
    324319 
    325320        // parse for specialtags 
     
    530525            case 'include': 
    531526                $path = realpath($this->config['skin_path'].$attrib['file']); 
    532                 if ($fsize = filesize($path)) { 
     527                if (is_readable($path)) { 
    533528                    if ($this->config['skin_include_php']) { 
    534529                        $incl = $this->include_php($path); 
    535530                    } 
    536                     else if ($fp = fopen($path, 'r')) { 
    537                         $incl = fread($fp, $fsize); 
    538                         fclose($fp); 
    539                     } 
     531                    else { 
     532                        $incl = file_get_contents($path); 
     533                    } 
    540534                    return $this->parse_xml($incl); 
    541535                } 
  • program/lib/html2text.php

    r47124c22 rff73e02  
    275275    function set_html( $source, $from_file = false ) 
    276276    { 
    277         $this->html = $source; 
    278  
    279277        if ( $from_file && file_exists($source) ) { 
    280             $fp = fopen($source, 'r'); 
    281             $this->html = fread($fp, filesize($source)); 
    282             fclose($fp); 
    283         } 
     278            $this->html = file_get_contents($source); 
     279        } 
     280        else 
     281            $this->html = $source; 
    284282 
    285283        $this->_converted = false; 
Note: See TracChangeset for help on using the changeset viewer.