summaryrefslogtreecommitdiff
path: root/modules/rest
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-06-15 20:21:10 -0700
committerBharat Mediratta <bharat@menalto.com>2010-06-15 20:21:10 -0700
commit57b53e6193cc6baf12bf58d8e528518a93bff03c (patch)
tree0ba3537c39166d19fa3185f6e52d5196e73f38f1 /modules/rest
parenta432a43b3b39fbec70d4cece1eb0ba5625b2679c (diff)
Guard against relationships() not returning an array.
Diffstat (limited to 'modules/rest')
-rw-r--r--modules/rest/helpers/rest.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/rest/helpers/rest.php b/modules/rest/helpers/rest.php
index 3229330a..b382cb29 100644
--- a/modules/rest/helpers/rest.php
+++ b/modules/rest/helpers/rest.php
@@ -137,9 +137,9 @@ class rest_Core {
foreach (glob(MODPATH . "{$module->name}/helpers/*_rest.php") as $filename) {
$class = str_replace(".php", "", basename($filename));
if (method_exists($class, "relationships")) {
- $results = array_merge(
- $results,
- call_user_func(array($class, "relationships"), $resource_type, $resource));
+ if ($tmp = call_user_func(array($class, "relationships"), $resource_type, $resource)) {
+ $results = array_merge($results, $tmp);
+ }
}
}
}