$args = $args[0];
}
// Are we dealing with a function or a method?
- if (substr($method, 0, 5) == 'this:') {
+ if ( is_string( $method ) && substr($method, 0, 5) == 'this:' ) {
// It's a class method - check it exists
$method = substr($method, 5);
if (!method_exists($this, $method)) {
$gettingHeaders = false;
}
if (!$gettingHeaders) {
- $contents .= trim($line);
+ // WP#12559 remove trim so as to not strip newlines from received response.
+ $contents .= $line;
}
if ($this->debug) {
$debug_contents .= $line;