WordPress.org

Make WordPress Core

Changeset 9301


Ignore:
Timestamp:
10/23/2008 07:39:17 PM (13 years ago)
Author:
ryan
Message:

wp_get_http() fixes. see #7944

File:
1 edited

Legend:

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

    r9270 r9301  
    10551055        return $headers;
    10561056
    1057     // GET request - fetch and write it to the supplied filename
    1058     $content_length = isset( $headers['content-length'] ) ? $headers['content-length'] : strlen( $response['body'] );
    1059     $got_bytes = 0;
     1057    // GET request - write it to the supplied filename
    10601058    $out_fp = fopen($file_path, 'w');
    1061     while ( !feof($fp) ) {
    1062         $buf = fread( $fp, 4096 );
    1063         fwrite( $out_fp, $buf );
    1064         $got_bytes += strlen($buf);
    1065         // don't read past the content-length
    1066         if ($content_length and $got_bytes >= $content_length)
    1067             break;
    1068     }
    1069 
     1059    if ( !$out_fp )
     1060        return $headers;
     1061
     1062    fwrite( $out_fp,  $response['body']);
    10701063    fclose($out_fp);
    10711064
Note: See TracChangeset for help on using the changeset viewer.