Skip to content

Commit a728d5f

Browse files
committed
Fixed regression in HttpClient.
1 parent 3901693 commit a728d5f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

xf/io/HttpClient.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ private static function status_line($response_headers) {
2323
* @return \StdObject with properties status, code, data, and headers
2424
*/
2525
public static function get($url, $headers=array()) {
26-
if (strpos($url, 'http://') !== 0 and strpos($url, 'https://')) {
27-
throw new Exception("Only http:// and https:// URLs are supported but found ".$url);
26+
if (strpos($url, 'http://') !== 0 and strpos($url, 'https://') !== 0) {
27+
throw new \Exception("Only http:// and https:// URLs are supported but found ".$url);
2828
}
2929
// use key 'http' even if you send the request to https://...
3030
$headerStr = '';
@@ -42,7 +42,7 @@ public static function get($url, $headers=array()) {
4242
$context = stream_context_create($options);
4343
$result = file_get_contents($url, false, $context);
4444
if (!@$http_response_header) {
45-
throw new Exception("There was a problem with the request. No response header received");
45+
throw new \Exception("There was a problem with the request. No response header received");
4646
}
4747
$status_line = self::status_line($http_response_header);
4848
preg_match('{HTTP\/\S*\s(\d{3})}', $status_line, $match);

0 commit comments

Comments
 (0)