diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-24 19:18:29 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-24 19:18:29 +0000 |
commit | 3420501153eb3e0cb27c75888e80cbf3d603dd19 (patch) | |
tree | bfbaee674075f73ccd436ad7290dc92dc0e9cbf6 | |
parent | 650c0c1f7dc35dab424402c66c57f55d6db00324 (diff) | |
download | elgg-3420501153eb3e0cb27c75888e80cbf3d603dd19.tar.gz elgg-3420501153eb3e0cb27c75888e80cbf3d603dd19.tar.bz2 |
API Client bugfixes
git-svn-id: https://code.elgg.org/elgg/trunk@1517 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | engine/lib/api.php | 10 |
1 files changed, 5 insertions, 5 deletions
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 |