alecpl
2011-08-26 a98ee35134d7cbe112c6074d48a2a22e506ef2f3
- Microoptimization: use substr_replace() for injecting a string into string


1 files modified
6 ■■■■ changed files
program/include/rcube_html_page.php 6 ●●●● patch | view | raw | blame | history
program/include/rcube_html_page.php
@@ -246,7 +246,7 @@
        // add page hader
        if ($hpos) {
            $output = substr($output,0,$hpos) . $page_header . substr($output,$hpos,strlen($output));
            $output = substr_replace($output, $page_header, $hpos, 0);
        }
        else {
            $output = $page_header . $output;
@@ -254,7 +254,7 @@
        // add page footer
        if (($fpos = strripos($output, '</body>')) || ($fpos = strripos($output, '</html>'))) {
            $output = substr($output, 0, $fpos) . "$page_footer\n" . substr($output, $fpos);
            $output = substr_replace($output, $page_footer."\n", $fpos, 0);
        }
        else {
            $output .= "\n".$page_footer;
@@ -268,7 +268,7 @@
            foreach ($this->css_files as $file) {
                $css .= sprintf($this->link_css_file, $file);
            }
            $output = substr($output, 0, $pos) . $css . substr($output, $pos);
            $output = substr_replace($output, $css, $pos, 0);
        }
        $this->base_path = $base_path;