php_errormsg is deprecated

pull/2670/head
Isaac Connor 2019-07-19 16:32:40 -04:00
parent 1e0c39c632
commit fe71a9abaa
1 changed files with 4 additions and 2 deletions

View File

@ -2459,11 +2459,13 @@ function do_post_request($url, $data, $optional_headers = null) {
$ctx = stream_context_create($params);
$fp = @fopen($url, 'rb', false, $ctx);
if ( !$fp ) {
throw new Exception("Problem with $url, $php_errormsg");
throw new Exception("Problem with $url, "
.print_r(error_get_last(),true));
}
$response = @stream_get_contents($fp);
if ( $response === false ) {
throw new Exception("Problem reading data from $url, $php_errormsg");
throw new Exception("Problem reading data from $url, data: ".print_r($params,true)
.print_r(error_get_last(),true));
}
return $response;
}