From d0dd6650bea15a30a2da66f996980a269a5f9c44 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 23 Dec 2009 13:13:03 -0800 Subject: When normalizing the rest request don't assume that the additional arguments are acutall a path. Leave it up to the handler to determine. --- modules/image_block/helpers/image_block_rest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'modules/image_block') diff --git a/modules/image_block/helpers/image_block_rest.php b/modules/image_block/helpers/image_block_rest.php index eca74941..363eabee 100644 --- a/modules/image_block/helpers/image_block_rest.php +++ b/modules/image_block/helpers/image_block_rest.php @@ -19,7 +19,8 @@ */ class image_block_rest_Core { static function get($request) { - switch ($request->path) { + $path = implode("/", $request->arguments); + switch ($path) { case "random": $random = ((float)mt_rand()) / (float)mt_getrandmax(); @@ -41,7 +42,7 @@ class image_block_rest_Core { } break; default: - return rest::fail("Unsupported block type: '{$request->path}'"); + return rest::fail("Unsupported block type: '{$path}'"); } if ($items->count() > 0) { -- cgit v1.2.3