From 57b53e6193cc6baf12bf58d8e528518a93bff03c Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 15 Jun 2010 20:21:10 -0700 Subject: Guard against relationships() not returning an array. --- modules/rest/helpers/rest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/rest') 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); + } } } } -- cgit v1.2.3