alecpl
2009-07-11 5f571eb1dba01a5f257c52978f30cd53d773d15c
- few fixes for last commits


2 files modified
13 ■■■■■ changed files
program/include/rcube_imap.php 6 ●●●● patch | view | raw | blame | history
program/lib/imap.inc 7 ●●●●● patch | view | raw | blame | history
program/include/rcube_imap.php
@@ -1162,7 +1162,7 @@
      // write structure to cache
      if ($this->caching_enabled)
        $this->add_message_cache($cache_key, $msg_id, $headers, $struct);
        $this->add_message_cache($cache_key, $this->_msg_id, $headers, $struct);
      }
    return $struct;
@@ -1442,6 +1442,10 @@
      {
      $structure_str = iil_C_FetchStructureString($this->conn, $this->mailbox, $uid, true); 
      $structure = iml_GetRawStructureArray($structure_str);
      // error or message not found
      if (empty($structure))
        return false;
      $part_type = iml_GetPartTypeCode($structure, $part);
      $o_part = new rcube_message_part;
      $o_part->ctype_primary = $part_type==0 ? 'text' : ($part_type==2 ? 'message' : 'other');
program/lib/imap.inc
@@ -2338,9 +2338,9 @@
                echo $result;
            } else
                return $result; // substr($result, 0, strlen($result)-1);
            }
            
        return true;
            }
    }
    
    return false;
@@ -2480,12 +2480,11 @@
            do {
                $line = iil_ReadLine($fp, 5000);
                $line = iil_MultLine($fp, $line);
                list(, $index, $cmd, $rest) = explode(' ', $line);
                if ($cmd != 'FETCH' || $index == $id || preg_match("/^$key/", $line))
                if (!preg_match("/^$key/", $line))
                    $result .= $line;
            } while (!preg_match("/^$key/", $line));
            $result = trim(substr($result, strpos($result, 'BODYSTRUCTURE')+13, -(strlen($result)-strrpos($result, $key)+1)));
            $result = trim(substr($result, strpos($result, 'BODYSTRUCTURE')+13, -1));
        }
    }
    return $result;