Make WordPress Core


Ignore:
Timestamp:
07/22/2013 06:55:05 PM (11 years ago)
Author:
nacin
Message:

Rename limit-response-size to limit_response_size. see #23472.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-http.php

    r24503 r24767  
    9898            'stream' => false,
    9999            'filename' => null,
    100             'limit-response-size' => null,
     100            'limit_response_size' => null,
    101101        );
    102102
     
    745745        $keep_reading = true;
    746746        $block_size = 4096;
    747         if ( isset( $r['limit-response-size'] ) )
    748             $block_size = min( $block_size, $r['limit-response-size'] );
     747        if ( isset( $r['limit_response_size'] ) )
     748            $block_size = min( $block_size, $r['limit_response_size'] );
    749749
    750750        // If streaming to a file setup the file handle
     
    771771                }
    772772
    773                 if ( isset( $r['limit-response-size'] ) && ( $bytes_written + strlen( $block ) ) > $r['limit-response-size'] )
    774                     $block = substr( $block, 0, ( $r['limit-response-size'] - $bytes_written ) );
     773                if ( isset( $r['limit_response_size'] ) && ( $bytes_written + strlen( $block ) ) > $r['limit_response_size'] )
     774                    $block = substr( $block, 0, ( $r['limit_response_size'] - $bytes_written ) );
    775775
    776776                $bytes_written += fwrite( $stream_handle, $block );
    777777
    778                 $keep_reading = !isset( $r['limit-response-size'] ) || $bytes_written < $r['limit-response-size'];
     778                $keep_reading = !isset( $r['limit_response_size'] ) || $bytes_written < $r['limit_response_size'];
    779779            }
    780780
     
    790790                    $bodyStarted = true;
    791791                }
    792                 $keep_reading = ( ! $bodyStarted || !isset( $r['limit-response-size'] ) || strlen( $strResponse ) < ( $header_length + $r['limit-response-size'] ) );
     792                $keep_reading = ( ! $bodyStarted || !isset( $r['limit_response_size'] ) || strlen( $strResponse ) < ( $header_length + $r['limit_response_size'] ) );
    793793            }
    794794
     
    821821            $process['body'] = WP_Http_Encoding::decompress( $process['body'] );
    822822
    823         if ( isset( $r['limit-response-size'] ) && strlen( $process['body'] ) > $r['limit-response-size'] )
    824             $process['body'] = substr( $process['body'], 0, $r['limit-response-size'] );
     823        if ( isset( $r['limit_response_size'] ) && strlen( $process['body'] ) > $r['limit_response_size'] )
     824            $process['body'] = substr( $process['body'], 0, $r['limit_response_size'] );
    825825
    826826        return array( 'headers' => $arrHeaders['headers'], 'body' => $process['body'], 'response' => $arrHeaders['response'], 'cookies' => $arrHeaders['cookies'], 'filename' => $r['filename'] );
     
    968968        }
    969969
    970         $max_bytes = isset( $r['limit-response-size'] ) ? intval( $r['limit-response-size'] ) : -1;
     970        $max_bytes = isset( $r['limit_response_size'] ) ? intval( $r['limit_response_size'] ) : -1;
    971971        if ( $r['stream'] ) {
    972972            if ( ! WP_DEBUG )
     
    11831183        curl_setopt( $handle, CURLOPT_HEADER, false );
    11841184
    1185         if ( isset( $r['limit-response-size'] ) )
    1186             $this->max_body_length = intval( $r['limit-response-size'] );
     1185        if ( isset( $r['limit_response_size'] ) )
     1186            $this->max_body_length = intval( $r['limit_response_size'] );
    11871187        else
    11881188            $this->max_body_length = false;
     
    18481848        elseif ( $args['stream'] ) // disable when streaming to file
    18491849            $compression_enabled = false;
    1850         elseif ( isset( $args['limit-response-size'] ) ) // If only partial content is being requested, we won't be able to decompress it
     1850        elseif ( isset( $args['limit_response_size'] ) ) // If only partial content is being requested, we won't be able to decompress it
    18511851            $compression_enabled = false;
    18521852
Note: See TracChangeset for help on using the changeset viewer.