SimplePie_HTTP_Parser::prepareHeaders() – Prepare headers (take care of proxies headers)

You appear to be a bot. Output may be restricted

Description

Prepare headers (take care of proxies headers)

Usage

$string = SimplePie_HTTP_Parser::prepareHeaders( $headers, $count );

Parameters

$headers
( string ) required – Raw headers
$count
( integer ) optional default: 1 – Redirection count. Default to 1.

Returns

string

Source

File name: wordpress/wp-includes/SimplePie/HTTP/Parser.php


Lines:

1 to 15 of 15
  static public function prepareHeaders($headers, $count = 1)
  {
    $data = explode("\r\n\r\n", $headers, $count);
    $data = array_pop($data);
    if (false !== stripos($data, "HTTP/1.0 200 Connection established\r\n")) {
      $exploded = explode("\r\n\r\n", $data, 2);
      $data = end($exploded);
    }
    if (false !== stripos($data, "HTTP/1.1 200 Connection established\r\n")) {
      $exploded = explode("\r\n\r\n", $data, 2);
      $data = end($exploded);
    }
    return $data;
  }
 

 View on GitHub View on Trac