- Patch #578470 by jbrauer, Gabor, Dries: XML-RPC error handling was incomplete.
parent
1bd038b09d
commit
404fcf299f
|
@ -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.
|
// Parse the URL, and make sure we can handle the schema.
|
||||||
$uri = parse_url($url);
|
$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']) {
|
switch ($uri['scheme']) {
|
||||||
case 'http':
|
case 'http':
|
||||||
$port = isset($uri['port']) ? $uri['port'] : 80;
|
$port = isset($uri['port']) ? $uri['port'] : 80;
|
||||||
|
@ -441,6 +453,7 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data =
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$result->error = 'invalid schema '. $uri['scheme'];
|
$result->error = 'invalid schema '. $uri['scheme'];
|
||||||
|
$result->code = -1003;
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue