Skip to content

Commit

Permalink
fix undefined variable $http_response_header
Browse files Browse the repository at this point in the history
If there is no connection to remote URL, the $http_response_header
is not set.
  • Loading branch information
ruuter committed Jun 1, 2020
1 parent d9fbd02 commit b989ddd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ripcord/ripcord_client.php
Original file line number Diff line number Diff line change
Expand Up @@ -482,12 +482,14 @@ public function post( $url, $request )
);
$context = stream_context_create( $options );
$result = @file_get_contents( $url, false, $context );
$this->responseHeaders = $http_response_header;

if ( !$result )
{
throw new Ripcord_TransportException( 'Could not access ' . $url,
ripcord::cannotAccessURL );
}

$this->responseHeaders = $http_response_header;
return $result;
}
}
Expand Down

0 comments on commit b989ddd

Please sign in to comment.