summaryrefslogtreecommitdiff
path: root/modules/image_block
diff options
context:
space:
mode:
Diffstat (limited to 'modules/image_block')
-rw-r--r--modules/image_block/helpers/image_block_rest.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/image_block/helpers/image_block_rest.php b/modules/image_block/helpers/image_block_rest.php
index 363eabee..45f849b1 100644
--- a/modules/image_block/helpers/image_block_rest.php
+++ b/modules/image_block/helpers/image_block_rest.php
@@ -19,8 +19,8 @@
*/
class image_block_rest_Core {
static function get($request) {
- $path = implode("/", $request->arguments);
- switch ($path) {
+ $type = empty($request->type) ? "random" : $request->type;
+ switch ($type) {
case "random":
$random = ((float)mt_rand()) / (float)mt_getrandmax();
@@ -42,7 +42,7 @@ class image_block_rest_Core {
}
break;
default:
- return rest::fail("Unsupported block type: '{$path}'");
+ return rest::fail("Unsupported image block type: '{$type}'");
}
if ($items->count() > 0) {