alecpl
2008-08-06 ff73e02cced0abf176a5a7e8660860f6280da6fe
- fread() replaced by file_get_contents(), see comments in #1484880


3 files modified
37 ■■■■■ changed files
program/include/rcube_mdb2.php 7 ●●●● patch | view | raw | blame | history
program/include/rcube_template.php 22 ●●●●● patch | view | raw | blame | history
program/lib/html2text.php 8 ●●●●● patch | view | raw | blame | history
program/include/rcube_mdb2.php
@@ -566,12 +566,7 @@
    if (empty($file_name) || !is_string($file_name))
      return;
    $data = '';
    if ($fd = fopen($file_name, 'r'))
      {
      $data = fread($fd, filesize($file_name));
      fclose($fd);
      }
    $data = file_get_contents($file_name);
    if (strlen($data))
      sqlite_exec($dbh->connection, $data);
program/include/rcube_template.php
@@ -299,16 +299,13 @@
    private function parse($name = 'main', $exit = true)
    {
        $skin_path = $this->config['skin_path'];
        // read template file
        $templ = '';
        $path = "$skin_path/templates/$name.html";
        if (($fp = fopen($path, 'r')) === false) {
            $message = '';
        // read template file
    if (($templ = file_get_contents($path)) === false) {
            ob_start();
            fopen($path, 'r');
            $message.= ob_get_contents();
            file_get_contents($path);
            $message = ob_get_contents();
            ob_end_clean();
            raise_error(array(
                'code' => 501,
@@ -319,8 +316,6 @@
                ), true, true);
            return false;
        }
        $templ = fread($fp, filesize($path));
        fclose($fp);
        // parse for specialtags
        $output = $this->parse_conditions($templ);
@@ -529,14 +524,13 @@
            // include a file
            case 'include':
                $path = realpath($this->config['skin_path'].$attrib['file']);
                if ($fsize = filesize($path)) {
                if (is_readable($path)) {
                    if ($this->config['skin_include_php']) {
                        $incl = $this->include_php($path);
                    }
                    else if ($fp = fopen($path, 'r')) {
                        $incl = fread($fp, $fsize);
                        fclose($fp);
                    }
                    else {
                $incl = file_get_contents($path);
            }
                    return $this->parse_xml($incl);
                }
                break;
program/lib/html2text.php
@@ -274,13 +274,11 @@
     */
    function set_html( $source, $from_file = false )
    {
        $this->html = $source;
        if ( $from_file && file_exists($source) ) {
            $fp = fopen($source, 'r');
            $this->html = fread($fp, filesize($source));
            fclose($fp);
            $this->html = file_get_contents($source);
        }
    else
            $this->html = $source;
        $this->_converted = false;
    }