Changeset 5691 in subversion


Ignore:
Timestamp:
Jan 3, 2012 4:57:14 AM (17 months ago)
Author:
alec
Message:
  • Backport r5689 from trunk
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/release-0.7/program/include/rcube_imap_generic.php

    r5402 r5691  
    32333233            return false; 
    32343234        } 
     3235 
     3236        if (empty($part)) { 
     3237                    return $a; 
     3238            } 
     3239 
     3240        $ctype = is_string($a[0]) && is_string($a[1]) ? $a[0] . '/' . $a[1] : ''; 
     3241 
     3242        if (strcasecmp($ctype, 'message/rfc822') == 0) { 
     3243            $a = $a[8]; 
     3244        } 
     3245 
    32353246            if (strpos($part, '.') > 0) { 
    3236                     $original_part = $part; 
    3237                     $pos = strpos($part, '.'); 
    3238                     $rest = substr($original_part, $pos+1); 
    3239                     $part = substr($original_part, 0, $pos); 
    3240                     if ((strcasecmp($a[0], 'message') == 0) && (strcasecmp($a[1], 'rfc822') == 0)) { 
    3241                             $a = $a[8]; 
    3242                     } 
     3247                    $orig_part = $part; 
     3248                    $pos       = strpos($part, '.'); 
     3249                    $rest      = substr($orig_part, $pos+1); 
     3250                    $part      = substr($orig_part, 0, $pos); 
     3251 
    32433252                    return self::getStructurePartArray($a[$part-1], $rest); 
    32443253            } 
    3245         else if ($part>0) { 
    3246                     if (!is_array($a[0]) && (strcasecmp($a[0], 'message') == 0) 
    3247                 && (strcasecmp($a[1], 'rfc822') == 0)) { 
    3248                             $a = $a[8]; 
    3249                     } 
     3254        else if ($part > 0) { 
    32503255                    if (is_array($a[$part-1])) 
    32513256                return $a[$part-1]; 
    32523257                    else 
    32533258                return $a; 
    3254             } 
    3255         else if (($part == 0) || (empty($part))) { 
    3256                     return $a; 
    32573259            } 
    32583260    } 
Note: See TracChangeset for help on using the changeset viewer.