X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fmime.php;h=b165bd2881d2940cdca88502980ba37556fd8cce;hb=1c72b151600d032fa186f8bbe6190fdcd1710ec6;hp=0958e871ff7e93b920ed1def9238c7a21413e096;hpb=42a07ac1d5db307837d0b2af4ea1c0511cad0f5d;p=squirrelmail.git
diff --git a/functions/mime.php b/functions/mime.php
index 0958e871..b165bd28 100644
--- a/functions/mime.php
+++ b/functions/mime.php
@@ -376,9 +376,7 @@ function mime_fetch_body ($imap_stream, $id, $ent_id ) {
// that it is the first one. That is usually the case anyway.
if (!$ent_id)
$ent_id = 1;
- $sid = sqimap_session_id();
- fputs ($imap_stream, "$sid FETCH $id BODY[$ent_id]\r\n");
- $data = sqimap_read_data ($imap_stream, $sid, true, $response, $message);
+ $data = sqimap_run_command ($imap_stream, " FETCH $id BODY[$ent_id]", true, $response, $message);
$topline = array_shift($data);
while (! ereg('\\* [0-9]+ FETCH ', $topline) && $data)
$topline = array_shift($data);
@@ -390,8 +388,7 @@ function mime_fetch_body ($imap_stream, $id, $ent_id ) {
in order to parse html messages. Let's get them here.
*/
if ( $ret{0} == '<' ) {
- fputs ($imap_stream, "$sid FETCH $id BODY[$ent_id.MIME]\r\n");
- $data = sqimap_read_data ($imap_stream, $sid, true, $response, $message);
+ $data = sqimap_run_command ($imap_stream, "FETCH $id BODY[$ent_id.MIME]", true, $response, $message);
$base = '';
$k = 10;
foreach( $data as $d ) {
@@ -436,8 +433,7 @@ function mime_fetch_body ($imap_stream, $id, $ent_id ) {
_("Message:") . " $message
" .
_("FETCH line:") . " $topline
";
- fputs ($imap_stream, "$sid FETCH $passed_id BODY[]\r\n");
- $data = sqimap_read_data ($imap_stream, $sid, true, $response, $message);
+ $data = sqimap_run_command ($imap_stream, "FETCH $passed_id BODY[]", true, $response, $message);
array_shift($data);
$wholemessage = implode('', $data);
@@ -1218,4 +1214,4 @@ function find_ent_id( $id, $message ) {
return( $ret );
}
-?>
\ No newline at end of file
+?>