From: Michael J. Rubinsky Date: Tue, 24 Nov 2009 23:00:46 +0000 (-0500) Subject: Don't assume Single resources, use array_key_exists since this value could be empty... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=6fa2dc3a94514ff310a8301d6eace08d9d055057;p=horde.git Don't assume Single resources, use array_key_exists since this value could be empty or null --- 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];