Changeset 24767 for trunk/wp-includes/class-http.php
- Timestamp:
- 07/22/2013 06:55:05 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-http.php
r24503 r24767 98 98 'stream' => false, 99 99 'filename' => null, 100 'limit -response-size' => null,100 'limit_response_size' => null, 101 101 ); 102 102 … … 745 745 $keep_reading = true; 746 746 $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'] ); 749 749 750 750 // If streaming to a file setup the file handle … … 771 771 } 772 772 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 ) ); 775 775 776 776 $bytes_written += fwrite( $stream_handle, $block ); 777 777 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']; 779 779 } 780 780 … … 790 790 $bodyStarted = true; 791 791 } 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'] ) ); 793 793 } 794 794 … … 821 821 $process['body'] = WP_Http_Encoding::decompress( $process['body'] ); 822 822 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'] ); 825 825 826 826 return array( 'headers' => $arrHeaders['headers'], 'body' => $process['body'], 'response' => $arrHeaders['response'], 'cookies' => $arrHeaders['cookies'], 'filename' => $r['filename'] ); … … 968 968 } 969 969 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; 971 971 if ( $r['stream'] ) { 972 972 if ( ! WP_DEBUG ) … … 1183 1183 curl_setopt( $handle, CURLOPT_HEADER, false ); 1184 1184 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'] ); 1187 1187 else 1188 1188 $this->max_body_length = false; … … 1848 1848 elseif ( $args['stream'] ) // disable when streaming to file 1849 1849 $compression_enabled = false; 1850 elseif ( isset( $args['limit -response-size'] ) ) // If only partial content is being requested, we won't be able to decompress it1850 elseif ( isset( $args['limit_response_size'] ) ) // If only partial content is being requested, we won't be able to decompress it 1851 1851 $compression_enabled = false; 1852 1852
Note: See TracChangeset
for help on using the changeset viewer.