diff options
-rw-r--r-- | CHANGELOG.txt | 2 | ||||
-rw-r--r-- | includes/common.inc | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e6c15c9f3..b3f02c5cb 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,8 @@ Drupal 7.22, xxxx-xx-xx (development version) ----------------------- +- Allowed the drupal_http_request() function to be overridden so that + additional HTTP request capabilities can be added by contributed modules. - Changed the Simpletest module to allow PSR-0 test classes to be used in Drupal 7. - Removed an unnecessary "Content-Disposition" header from private file diff --git a/includes/common.inc b/includes/common.inc index d6fd67eeb..27fa190e0 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -785,6 +785,13 @@ function drupal_access_denied() { * - data: A string containing the response body that was received. */ function drupal_http_request($url, array $options = array()) { + // Allow an alternate HTTP client library to replace Drupal's default + // implementation. + $override_function = variable_get('drupal_http_request_function', FALSE); + if (!empty($override_function) && function_exists($override_function)) { + return $override_function($url, $options); + } + $result = new stdClass(); // Parse the URL and make sure we can handle the schema. |