/**
* mime.php
*
- * Copyright (c) 1999-2004 The SquirrelMail Project Team
+ * Copyright (c) 1999-2005 The SquirrelMail Project Team
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* This contains the functions necessary to detect and decode MIME
* primary message. To add more of them, just put them in the
* order that is their priority.
*/
- global $startMessage, $username, $key, $imapServerAddress, $imapPort,
+ global $startMessage, $languages, $squirrelmail_language,
$show_html_default, $sort, $has_unsafe_images, $passed_ent_id;
- global $languages, $squirrelmail_language;
if( !sqgetGlobalVar('view_unsafe_images', $view_unsafe_images, SQ_GET) ) {
$view_unsafe_images = false;
function formatAttachments($message, $exclude_id, $mailbox, $id) {
- global $where, $what, $startMessage, $color;
- static $ShownHTML = 0;
+ global $where, $what, $startMessage, $color, $passed_ent_id;
$att_ar = $message->getAttachments($exclude_id);
$links['download link']['text'] = _("Download");
$links['download link']['href'] = SM_PATH .
"src/download.php?absolute_dl=true&passed_id=$id&mailbox=$urlMailbox&ent_id=$ent";
- $ImageURL = '';
if ($type0 =='message' && $type1 == 'rfc822') {
$default_page = SM_PATH . 'src/read_body.php';
$rfc822_header = $att->rfc822_header;
{
case 'B':
$replace = base64_decode($res[4]);
- if ($can_be_encoded) {
- /* convert string to different charset,
- * if functions asks for it (usually in compose)
- */
- $ret .= charset_convert($res[2],$replace,$default_charset);
+ if ($utfencode) {
+ if ($can_be_encoded) {
+ /* convert string to different charset,
+ * if functions asks for it (usually in compose)
+ */
+ $ret .= charset_convert($res[2],$replace,$default_charset);
+ } else {
+ // convert string to html codes in order to display it
+ $ret .= charset_decode($res[2],$replace);
+ }
} else {
- // convert string to html codes in order to display it
- $ret .= charset_decode($res[2],$replace);
+ if ($htmlsave) {
+ $replace = htmlspecialchars($replace);
+ }
+ $ret.= $replace;
}
break;
case 'Q':
break;
}
- $tag_start = $pos;
$tagname = '';
/**
* Look for next [\W-_], which will indicate the end of the tag name.
* At this point we loop in order to find all attributes.
*/
$attname = '';
- $atttype = false;
$attary = Array();
while ($pos <= strlen($body)){
function sq_body2div($attary, $mailbox, $message, $id){
$me = 'sq_body2div';
$divattary = Array('class' => "'bodyclass'");
- $bgcolor = '#ffffff';
$text = '#000000';
$has_bgc_stl = $has_txt_stl = false;
$styledef = '';