diff options
author | David Rothstein <drothstein@gmail.com> | 2013-04-01 23:01:21 -0400 |
---|---|---|
committer | David Rothstein <drothstein@gmail.com> | 2013-04-01 23:01:21 -0400 |
commit | 025ad199b53fbe8db4c71f59f8493e61116b5e46 (patch) | |
tree | b987682c6b7847dea3b8070250d449de2f2dd4c7 /includes/common.inc | |
parent | 7cbe4b7e265343773c2cd2e50b86c68182a64f8e (diff) | |
download | brdo-025ad199b53fbe8db4c71f59f8493e61116b5e46.tar.gz brdo-025ad199b53fbe8db4c71f59f8493e61116b5e46.tar.bz2 |
Issue #1664784 by effulgentsia, mikeytown2: Allow drupal_http_request() to be overridden.
Diffstat (limited to 'includes/common.inc')
-rw-r--r-- | includes/common.inc | 7 |
1 files changed, 7 insertions, 0 deletions
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. |