File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -23,8 +23,8 @@ private static function status_line($response_headers) {
23
23
* @return \StdObject with properties status, code, data, and headers
24
24
*/
25
25
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 );
28
28
}
29
29
// use key 'http' even if you send the request to https://...
30
30
$ headerStr = '' ;
@@ -42,7 +42,7 @@ public static function get($url, $headers=array()) {
42
42
$ context = stream_context_create ($ options );
43
43
$ result = file_get_contents ($ url , false , $ context );
44
44
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 " );
46
46
}
47
47
$ status_line = self ::status_line ($ http_response_header );
48
48
preg_match ('{HTTP\/\S*\s(\d{3})} ' , $ status_line , $ match );
You can’t perform that action at this time.
0 commit comments