summaryrefslogtreecommitdiff
path: root/roundcubemail/program/lib
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-08-18 12:33:26 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-08-18 12:33:26 +0000
commit9cb8f1030dc282420855d1f186d74b1deeb3ec24 (patch)
tree84975747a2f032cfa8eb3ebabefc20a45acc3c48 /roundcubemail/program/lib
parent196cfa0d479d2ac25773ddb8fcdc36eb4ea498c5 (diff)
Better fix for bodystructure parsing (#1485280)
git-svn-id: https://svn.roundcube.net/trunk@1658 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/lib')
-rw-r--r--roundcubemail/program/lib/imap.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/roundcubemail/program/lib/imap.inc b/roundcubemail/program/lib/imap.inc
index 600b0d408..84d1b36b9 100644
--- a/roundcubemail/program/lib/imap.inc
+++ b/roundcubemail/program/lib/imap.inc
@@ -2576,11 +2576,11 @@ function iil_C_FetchStructureString(&$conn, $folder, $id) {
$line = iil_ReadLine($fp, 5000);
$line = iil_MultLine($fp, $line);
list(, $index, $cmd, $rest) = explode(' ', $line);
- if ($cmd != 'FETCH' || $index == $id)
+ if ($cmd != 'FETCH' || $index == $id || preg_match("/^$key/", $line))
$result .= $line;
} while (!preg_match("/^$key/", $line));
- $result = trim(substr($result, strpos($result, 'BODYSTRUCTURE')+13));
+ $result = trim(substr($result, strpos($result, 'BODYSTRUCTURE')+13, -(strlen($result)-strrpos($result, $key)+1)));
}
}
return $result;