check for ent_id instead of passed_ent_id
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 6 Aug 2002 22:55:55 +0000 (22:55 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 6 Aug 2002 22:55:55 +0000 (22:55 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3265 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/view_text.php

index 2b983cb940b82060b78d4d015cb397845230e675..d8bf19f8c8f345db61943ce1057b37c324d44fb1 100644 (file)
@@ -1,21 +1,10 @@
 <?php
 
-/**
- * view_text.php
- *
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
- * Licensed under the GNU GPL. For full terms see the file COPYING.
- *
- * This is the code to view the text attachments.
- *
- * $Id$
- */
-
-
    require_once('../src/validate.php');
    require_once('../functions/imap.php');
    require_once('../functions/mime.php');
-
+   require_once('../functions/html.php');
+   
    $mailbox = urldecode($mailbox);
    if (!isset($passed_ent_id)) {
       $passed_ent_id = '';
    $mbx_response =  sqimap_mailbox_select($imapConnection, $mailbox);
 
    $message = &$messages[$mbx_response['UIDVALIDITY']]["$passed_id"];
-   $message = &$message->getEntity($passed_ent_id);
+   $message = &$message->getEntity($ent_id);
 
    $header = $message->header;
-   $charset = $header->charset;
+   $charset = $header->getParameter('charset');
    $type0 = $header->type0;
    $type1 = $header->type1;
    $encoding = strtolower($header->encoding);
 
    $msg_url = 'read_body.php?' . $QUERY_STRING;
+   $msg_url = set_url_var($msg_url, 'ent_id', 0);
 
    $body = mime_fetch_body($imapConnection, $passed_id, $passed_ent_id);
    $body = decodeBody($body, $encoding);
@@ -63,6 +53,4 @@
     }
     echo $body .
          "</TT></TD></TR></TABLE>";
-    
-    sqimap_logout($imapConnection);     
 ?>