Commit 7988f875 authored by Dries's avatar Dries
Browse files

- Fixed PHP5 warning: the $result object in drupal_http_request() needed to be properly initialized using 'new StdClass'.

  (I just installed PHP 5.0.3, no less.  Why don't you?)
parent ee65e19a
...@@ -223,6 +223,8 @@ function drupal_access_denied() { ...@@ -223,6 +223,8 @@ function drupal_access_denied() {
* data, and redirect status. * data, and redirect status.
*/ */
function drupal_http_request($url, $headers = array(), $method = 'GET', $data = NULL, $retry = 3) { function drupal_http_request($url, $headers = array(), $method = 'GET', $data = NULL, $retry = 3) {
$result = new StdClass();
// 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);
switch ($uri['scheme']) { switch ($uri['scheme']) {
...@@ -385,7 +387,7 @@ function fix_gpc_magic() { ...@@ -385,7 +387,7 @@ function fix_gpc_magic() {
*/ */
function array2object($array) { function array2object($array) {
if (is_array($array)) { if (is_array($array)) {
$object = new stdClass(); $object = new StdClass();
foreach ($array as $key => $value) { foreach ($array as $key => $value) {
$object->$key = $value; $object->$key = $value;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment