WordPress at Your Fingertips
function is not described

SimplePie_HTTP_Parser::new_line() protected WP 1.0

Deal with a new line, shifting data around as needed

{} It's a method of the class: SimplePie_HTTP_Parser{}

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->new_line();

Code of SimplePie_HTTP_Parser::new_line() WP 5.8.2

protected function new_line()
{
	$this->value = trim($this->value, "\x0D\x20");
	if ($this->name !== '' && $this->value !== '')
	{
		$this->name = strtolower($this->name);
		// We should only use the last Content-Type header. c.f. issue #1
		if (isset($this->headers[$this->name]) && $this->name !== 'content-type')
		{
			$this->headers[$this->name] .= ', ' . $this->value;
		}
		else
		{
			$this->headers[$this->name] = $this->value;
		}
	}
	$this->name = '';
	$this->value = '';
	if (substr($this->data[$this->position], 0, 2) === "\x0D\x0A")
	{
		$this->position += 2;
		$this->state = 'body';
	}
	elseif ($this->data[$this->position] === "\x0A")
	{
		$this->position++;
		$this->state = 'body';
	}
	else
	{
		$this->state = 'name';
	}
}