- Patch #578470 by jbrauer, Gabor, Dries: XML-RPC error handling was incomplete.

5.x
Neil Drumm 2009-09-16 17:29:09 +00:00
parent 1bd038b09d
commit 404fcf299f
1 changed files with 13 additions and 0 deletions

View File

@ -427,6 +427,18 @@ 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 ($uri == FALSE) {
$result->error = 'unable to parse URL';
$result->code = -1001;
return $result;
}
if (!isset($uri['scheme'])) {
$result->error = 'missing schema';
$result->code = -1002;
return $result;
}
switch ($uri['scheme']) {
case 'http':
$port = isset($uri['port']) ? $uri['port'] : 80;
@ -441,6 +453,7 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data =
break;
default:
$result->error = 'invalid schema '. $uri['scheme'];
$result->code = -1003;
return $result;
}