]> git.donarmstrong.com Git - roundcube.git/blobdiff - program/include/rcube_imap.php
Imported Upstream version 0.5.3+dfsg
[roundcube.git] / program / include / rcube_imap.php
index 9a09180989a7a8d94ef8d84dd0d3d40a6cfcae3f..c27be0ccbf169b2eedb9daf96d43ebe3acb873de 100644 (file)
@@ -16,7 +16,7 @@
  | Author: Aleksander Machniak <alec@alec.pl>                            |
  +-----------------------------------------------------------------------+
 
- $Id: rcube_imap.php 4643 2011-04-11 12:24:00Z alec $
+ $Id: rcube_imap.php 4763 2011-05-13 17:31:09Z alec $
 
 */
 
@@ -3564,7 +3564,7 @@ class rcube_imap
             return $this->conn->setMetadata($mailbox, $entries);
         }
         else if ($this->get_capability('ANNOTATEMORE') || $this->get_capability('ANNOTATEMORE2')) {
-            foreach ($entries as $entry => $value) {
+            foreach ((array)$entries as $entry => $value) {
                 list($ent, $attr) = $this->md2annotate($entry);
                 $entries[$entry] = array($ent, $attr, $value);
             }
@@ -3597,7 +3597,7 @@ class rcube_imap
             return $this->conn->deleteMetadata($mailbox, $entries);
         }
         else if ($this->get_capability('ANNOTATEMORE') || $this->get_capability('ANNOTATEMORE2')) {
-            foreach ($entries as $idx => $entry) {
+            foreach ((array)$entries as $idx => $entry) {
                 list($ent, $attr) = $this->md2annotate($entry);
                 $entries[$idx] = array($ent, $attr, NULL);
             }
@@ -3626,7 +3626,7 @@ class rcube_imap
             $mailbox = $this->mod_mailbox($mailbox);
 
         if ($this->get_capability('METADATA') || 
-            !strlen(($mailbox) && $this->get_capability('METADATA-SERVER'))
+            (!strlen($mailbox) && $this->get_capability('METADATA-SERVER'))
         ) {
             return $this->conn->getMetadata($mailbox, $entries, $options);
         }
@@ -3635,7 +3635,7 @@ class rcube_imap
             $res     = array();
 
             // Convert entry names
-            foreach ($entries as $entry) {
+            foreach ((array)$entries as $entry) {
                 list($ent, $attr) = $this->md2annotate($entry);
                 $queries[$attr][] = $ent;
             }
@@ -3656,11 +3656,11 @@ class rcube_imap
      * Converts the METADATA extension entry name into the correct
      * entry-attrib names for older ANNOTATEMORE version.
      *
-     * @param string Entry name
+     * @param string $entry Entry name
      *
      * @return array Entry-attribute list, NULL if not supported (?)
      */
-    private function md2annotate($name)
+    private function md2annotate($entry)
     {
         if (substr($entry, 0, 7) == '/shared') {
             return array(substr($entry, 7), 'value.shared');