diff --git a/lib/Cake/Network/CakeRequest.php b/lib/Cake/Network/CakeRequest.php index 228e46e2e..7e5cc4bac 100644 --- a/lib/Cake/Network/CakeRequest.php +++ b/lib/Cake/Network/CakeRequest.php @@ -303,7 +303,7 @@ class CakeRequest implements ArrayAccess { return $this->base = $base; } - if (!$baseUrl) { + if (empty($baseUrl)) { $base = dirname(env('PHP_SELF')); // Clean up additional / which cause following code to fail.. $base = preg_replace('#/+#', '/', $base); diff --git a/lib/Cake/Utility/ObjectCollection.php b/lib/Cake/Utility/ObjectCollection.php index 77e4ad234..1e36e4c4d 100644 --- a/lib/Cake/Utility/ObjectCollection.php +++ b/lib/Cake/Utility/ObjectCollection.php @@ -126,7 +126,7 @@ abstract class ObjectCollection { } $result = null; foreach ($list as $name) { - $result = call_user_func_array(array($this->_loaded[$name], $callback), compact('subject') + $params); + $result = call_user_func_array(array($this->_loaded[$name], $callback), array_filter(compact('subject')) + $params); if ($options['collectReturn'] === true) { $collected[] = $result; }