From 6fa2dc3a94514ff310a8301d6eace08d9d055057 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Tue, 24 Nov 2009 18:00:46 -0500 Subject: [PATCH] Don't assume Single resources, use array_key_exists since this value could be empty or null --- kronolith/lib/Resource/Base.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/kronolith/lib/Resource/Base.php b/kronolith/lib/Resource/Base.php index 0979c0a96..8fa82de2e 100644 --- a/kronolith/lib/Resource/Base.php +++ b/kronolith/lib/Resource/Base.php @@ -45,12 +45,12 @@ abstract class Kronolith_Resource_Base if (empty($params['name'])) { throw new Horde_Exception('Required \'name\' attribute missing from resource calendar'); } - $this->_params = array_merge(array('description' => '', 'response_type' => Kronolith_Resource::RESPONSETYPE_MANUAL, 'members' => '', - 'type' => Kronolith_Resource::TYPE_SINGLE), + 'calendar' => ''), $params); + } /** @@ -105,8 +105,7 @@ abstract class Kronolith_Resource_Base if ($property == 'type' && empty($this->_params['type'])) { return ($this instanceof Kronolith_Resource_Single) ? 'Single' : 'Group'; } - - if (!isset($this->_params[$property])) { + if (!array_key_exists($property, $this->_params)) { throw new Horde_Exception(sprintf("The property \'%s\' does not exist", $property)); } return $this->_params[$property]; -- 2.11.0