diff options
author | Thomas Bruederli <bruederli@kolabsys.com> | 2014-06-02 21:27:44 (GMT) |
---|---|---|
committer | Thomas Bruederli <bruederli@kolabsys.com> | 2014-06-02 21:28:26 (GMT) |
commit | a84eb35f01bd02799f4f1ff7399ba0ac200dfc89 (patch) | |
tree | 84d2549be77852802a800e71c2f0590cd44a3f64 | |
parent | 26767a16698b459590283325c38b5feedbe4c9ca (diff) | |
download | roundcubemail-plugins-kolab-a84eb35f01bd02799f4f1ff7399ba0ac200dfc89.tar.gz |
Check existance of Configuration::customProperties() before calling it (#3125)
-rw-r--r-- | plugins/libkolab/lib/kolab_format.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/plugins/libkolab/lib/kolab_format.php b/plugins/libkolab/lib/kolab_format.php index fefef1b..be2a0b8 100644 --- a/plugins/libkolab/lib/kolab_format.php +++ b/plugins/libkolab/lib/kolab_format.php @@ -415,7 +415,7 @@ abstract class kolab_format $this->obj->setLastModified(self::get_datetime($object['changed'])); // Save custom properties of the given object - if (isset($object['x-custom'])) { + if (isset($object['x-custom']) && method_exists($this->obj, 'setCustomProperties')) { $vcustom = new vectorcs; foreach ((array)$object['x-custom'] as $cp) { if (is_array($cp)) @@ -423,7 +423,8 @@ abstract class kolab_format } $this->obj->setCustomProperties($vcustom); } - else { // load custom properties from XML for caching (#2238) + // load custom properties from XML for caching (#2238) if method exists (#3125) + else if (method_exists($this->obj, 'customProperties')) { $object['x-custom'] = array(); $vcustom = $this->obj->customProperties(); for ($i=0; $i < $vcustom->size(); $i++) { @@ -456,10 +457,12 @@ abstract class kolab_format } // read custom properties - $vcustom = $this->obj->customProperties(); - for ($i=0; $i < $vcustom->size(); $i++) { - $cp = $vcustom->get($i); - $object['x-custom'][] = array($cp->identifier, $cp->value); + if (method_exists($this->obj, 'customProperties')) { + $vcustom = $this->obj->customProperties(); + for ($i=0; $i < $vcustom->size(); $i++) { + $cp = $vcustom->get($i); + $object['x-custom'][] = array($cp->identifier, $cp->value); + } } // merge with additional data, e.g. attachments from the message |