Commit 89fffd24 authored by Dries's avatar Dries

- Patch #283806 by mustafau, Aron Noval: improved error handling in drupal_http_request().

parent 73f98066
......@@ -436,6 +436,16 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data =
// Parse the URL and make sure we can handle the schema.
$uri = parse_url($url);
if (!isset($uri['scheme'])) {
$result->error = 'missing schema';
return $result;
}
if (!isset($uri['host'])) {
$result->error = 'missing host';
return $result;
}
switch ($uri['scheme']) {
case 'http':
$port = isset($uri['port']) ? $uri['port'] : 80;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment