- Prevent from PHP warnings

pull/1/head
alecpl 13 years ago
parent 4deb1ef685
commit cc75440de2

@ -3249,29 +3249,31 @@ class rcube_imap_generic
if (!is_array($a)) {
return false;
}
if (strpos($part, '.') > 0) {
$original_part = $part;
$pos = strpos($part, '.');
$rest = substr($original_part, $pos+1);
$part = substr($original_part, 0, $pos);
if ((strcasecmp($a[0], 'message') == 0) && (strcasecmp($a[1], 'rfc822') == 0)) {
if (empty($part)) {
return $a;
}
$ctype = is_string($a[0]) && is_string($a[1]) ? $a[0] . '/' . $a[1] : '';
if (strcasecmp($ctype, 'message/rfc822') == 0) {
$a = $a[8];
}
if (strpos($part, '.') > 0) {
$orig_part = $part;
$pos = strpos($part, '.');
$rest = substr($orig_part, $pos+1);
$part = substr($orig_part, 0, $pos);
return self::getStructurePartArray($a[$part-1], $rest);
}
else if ($part>0) {
if (!is_array($a[0]) && (strcasecmp($a[0], 'message') == 0)
&& (strcasecmp($a[1], 'rfc822') == 0)) {
$a = $a[8];
}
else if ($part > 0) {
if (is_array($a[$part-1]))
return $a[$part-1];
else
return $a;
}
else if (($part == 0) || (empty($part))) {
return $a;
}
}
/**

Loading…
Cancel
Save