From 025ad199b53fbe8db4c71f59f8493e61116b5e46 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 1 Apr 2013 23:01:21 -0400 Subject: Issue #1664784 by effulgentsia, mikeytown2: Allow drupal_http_request() to be overridden. --- includes/common.inc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'includes') 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. -- cgit v1.2.3