Make WordPress Core

Changeset 4389


Ignore:
Timestamp:
10/13/2006 09:51:34 AM (20 years ago)
Author:
markjaquith
Message:

File handling tweaks in latest SimplePie trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/simplepie.php

    r4377 r4389  
    66
    77Version: "Lemon Meringue"
    8 Updated: 10 October 2006
     8Updated: 13 October 2006
    99Copyright: 2004-2006 Ryan Parman, Geoffrey Sneddon
    1010http://simplepie.org
    … …  
    2727        var $name = 'SimplePie';
    2828        var $version = 'Lemon Meringue';
    29         var $build = '20061010';
     29        var $build = '20061013';
    3030        var $url = 'http://simplepie.org/';
    3131        var $useragent;
    … …  
    408408                               
    409409                                // Check if the supplied URL is a feed, if it isn't, look for it.
    410                                 if (!call_user_func(array($this->locator_class, 'is_feed'), $file))
    411                                 {
    412                                         $locate = new $this->locator_class($file, $this->timeout, $this->useragent);
     410                                $locate = new $this->locator_class($file, $this->timeout, $this->useragent);
     411                                if (!$locate->is_feed($file))
     412                                {
    413413                                        $feed = $locate->find();
    414414                                        if ($feed)
    … …  
    21862186                                        $info = stream_get_meta_data($this->fp);
    21872187                                        $data = '';
    2188                                         while (strpos($data, "\r\n\r\n") === false && $info['timed_out'] === false)
     2188                                        while (strpos($data, "\r\n\r\n") === false && !$info['timed_out'])
    21892189                                        {
    21902190                                                $data .= fgets($this->fp, 128);
    21912191                                                $info = stream_get_meta_data($this->fp);
    21922192                                        }
    2193                                         if ($info['timed_out'] === false)
     2193                                        if (!$info['timed_out'])
    21942194                                        {
    21952195                                                $this->headers = $this->parse_headers($data);
    … …  
    22382238                        if ($this->fp)
    22392239                        {
     2240                                $info = stream_get_meta_data($this->fp);
    22402241                                $this->body = '';
    2241                                 while (!feof($this->fp))
     2242                                while (!$info['eof'] && !$info['timed_out'])
    22422243                                {
    22432244                                        $this->body .= fread($this->fp, 1024);
    2244                                 }
    2245                                 $this->body = trim($this->body);
    2246                                 if ($this->method == 'fsockopen' && !empty($this->headers['content-encoding']) && $this->headers['content-encoding'] == 'gzip')
    2247                                 {
    2248                                         $this->body = substr($this->body, 10);
    2249                                         $this->body = gzinflate($this->body);
    2250                                 }
    2251                                 $this->close();
     2245                                        $info = stream_get_meta_data($this->fp);
     2246                                }
     2247                                if (!$info['timed_out'])
     2248                                {
     2249                                        $this->body = trim($this->body);
     2250                                        if ($this->method == 'fsockopen' && !empty($this->headers['content-encoding']) && $this->headers['content-encoding'] == 'gzip')
     2251                                        {
     2252                                                $this->body = substr($this->body, 10);
     2253                                                $this->body = gzinflate($this->body);
     2254                                        }
     2255                                        $this->close();
     2256                                }
     2257                                else
     2258                                {
     2259                                        return false;
     2260                                }
    22522261                        }
    22532262                        else
Note: See TracChangeset for help on using the changeset viewer.