From 3420501153eb3e0cb27c75888e80cbf3d603dd19 Mon Sep 17 00:00:00 2001 From: marcus Date: Thu, 24 Jul 2008 19:18:29 +0000 Subject: API Client bugfixes git-svn-id: https://code.elgg.org/elgg/trunk@1517 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/api.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engine/lib') diff --git a/engine/lib/api.php b/engine/lib/api.php index 2d205fad7..5ce1f62fc 100644 --- a/engine/lib/api.php +++ b/engine/lib/api.php @@ -237,7 +237,7 @@ /** * Expose an arbitrary function as an api call. * - * Limitations: Currently can not expose functions which expect objects or arrays. + * Limitations: Currently can not expose functions which expect objects. * * @param string $method The api name to expose this as, eg "myapi.dosomething" * @param string $function Your function callback. @@ -770,10 +770,10 @@ $time = microtime(true); // Hard code the format - we're using PHP, so lets use PHP serialisation. - $method['format'] = "php"; + $call['format'] = "php"; // URL encode all the parameters - foreach ($method as $k => $v){ + foreach ($call as $k => $v){ $encoded_params[] = urlencode($k).'='.urlencode($v); } @@ -783,7 +783,7 @@ $url = $url . "?" . $params; // Construct headers - if ($method == 'POST') $posthash = calculate_posthash($postdata, 'md5'); + if ($method == 'POST') $posthash = calculate_posthash($post_data, 'md5'); $headers['X-Elgg-apikey'] = $keys['public']; $headers['X-Elgg-time'] = $time; @@ -800,7 +800,7 @@ $headers['X-Elgg-posthash'] = $posthash; $headers['X-Elgg-posthash-algo'] = 'md5'; $headers['Content-type'] = $content_type; - $headers['Content-Length'] = strlen($postdata); + $headers['Content-Length'] = strlen($post_data); } // Opt array -- cgit v1.2.3