diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-09-16 15:28:00 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-09-16 15:28:00 +0000 |
commit | f5d1094bbbae0170ce5de10879305fb180a85bf0 (patch) | |
tree | a84a86e1ca861523ad83b105b8d1bf8bf7a30fb6 /includes | |
parent | d61e0e8d39618bf532feb25d5e17a428ab8b4847 (diff) | |
download | brdo-f5d1094bbbae0170ce5de10879305fb180a85bf0.tar.gz brdo-f5d1094bbbae0170ce5de10879305fb180a85bf0.tar.bz2 |
#578470 by Dries, jbrauer, Gábor Hojtsy: Add return status codes to drupal_http_request() when a URL fails to parse, instead of failing silently.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/includes/common.inc b/includes/common.inc index de85c77a0..8d6b8c6a1 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -578,11 +578,13 @@ function drupal_http_request($url, array $options = array()) { 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; } @@ -611,6 +613,7 @@ function drupal_http_request($url, array $options = array()) { break; default: $result->error = 'invalid schema ' . $uri['scheme']; + $result->code = -1003; return $result; } |