Changeset 5135 in subversion


Ignore:
Timestamp:
Aug 26, 2011 5:22:53 AM (21 months ago)
Author:
alec
Message:
  • Microoptimization: use substr_replace() for injecting a string into string
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/rcube_html_page.php

    r4966 r5135  
    213213            $this->add_script('$(document).ready(function(){ ' . $this->scripts['docready'] . "\n});", 'foot'); 
    214214        } 
    215          
     215 
    216216        if (is_array($this->script_files['foot'])) { 
    217217            foreach ($this->script_files['foot'] as $file) { 
     
    247247        // add page hader 
    248248        if ($hpos) { 
    249             $output = substr($output,0,$hpos) . $page_header . substr($output,$hpos,strlen($output)); 
     249            $output = substr_replace($output, $page_header, $hpos, 0); 
    250250        } 
    251251        else { 
     
    255255        // add page footer 
    256256        if (($fpos = strripos($output, '</body>')) || ($fpos = strripos($output, '</html>'))) { 
    257             $output = substr($output, 0, $fpos) . "$page_footer\n" . substr($output, $fpos); 
     257            $output = substr_replace($output, $page_footer."\n", $fpos, 0); 
    258258        } 
    259259        else { 
     
    269269                $css .= sprintf($this->link_css_file, $file); 
    270270            } 
    271             $output = substr($output, 0, $pos) . $css . substr($output, $pos); 
     271            $output = substr_replace($output, $css, $pos, 0); 
    272272        } 
    273273 
     
    290290        } 
    291291    } 
    292      
     292 
    293293    /** 
    294294     * Callback function for preg_replace_callback in write() 
Note: See TracChangeset for help on using the changeset viewer.