} else {
$attachments .= ' | ';
}
- $attachments .= '<a href="' . $val['href'] . '">' . $val['text'] . '</a>';
+ $attachments .= '<a href="' . $val['href'] . '">' . (isset($val['text']) && !empty($val['text']) ? $val['text'] : '') . (isset($val['extra']) && !empty($val['extra']) ? $val['extra'] : '') . '</a>';
}
unset($links);
$attachments .= "</td></tr>\n";
// if (sq_check_save_extension($message->entities[$i])) {
return $message->entities[$i]->entity_id;
// }
+ } elseif (!empty($message->entities[$i]->header->parameters['name'])) {
+ /**
+ * This is part of a fix for Outlook Express 6.x generating
+ * cid URLs without creating content-id headers
+ * @@JA - 20050207
+ */
+ if (strcasecmp($message->entities[$i]->header->parameters['name'], $id) == 0) {
+ return $message->entities[$i]->entity_id;
+ }
}
}
}
}
}
}
+
+
+ /**
+ * Replace empty src tags with the blank image. src is only used
+ * for frames, images, and image inputs. Doing a replace should
+ * not affect them working as should be, however it will stop
+ * IE from being kicked off when src for img tags are not set
+ */
+ if (($attname == 'src') && ($attvalue == '""')) {
+ $attary{$attname} = '"' . SM_PATH . 'images/blank.png"';
+ }
+
/**
* Turn cid: urls into http-friendly ones.
*/
if (preg_match("/^[\'\"]\s*cid:/si", $attvalue)){
$attary{$attname} = sq_cid2http($message, $id, $attvalue, $mailbox);
}
+
+ /**
+ * "Hack" fix for Outlook using propriatary outbind:// protocol in img tags.
+ * One day MS might actually make it match something useful, for now, falling
+ * back to using cid2http, so we can grab the blank.png.
+ */
+ if (preg_match("/^[\'\"]\s*outbind:\/\//si", $attvalue)) {
+ $attary{$attname} = sq_cid2http($message, $id, $attvalue, $mailbox);
+ }
+
}
/**
* See if we need to append any attributes to this tag.
/* in case of non-save cid links $httpurl should be replaced by a sort of
unsave link image */
$httpurl = '';
- if ($linkurl) {
+
+ /**
+ * This is part of a fix for Outlook Express 6.x generating
+ * cid URLs without creating content-id headers. These images are
+ * not part of the multipart/related html mail. The html contains
+ * <img src="cid:{some_id}/image_filename.ext"> references to
+ * attached images with as goal to render them inline although
+ * the attachment disposition property is not inline.
+ **/
+
+ if (empty($linkurl)) {
+ if (preg_match('/{.*}\//', $cidurl)) {
+ $cidurl = preg_replace('/{.*}\//','', $cidurl);
+ if (!empty($cidurl)) {
+ $linkurl = find_ent_id($cidurl, $message);
+ }
+ }
+ }
+
+ if (!empty($linkurl)) {
$httpurl = $quotchar . SM_PATH . 'src/download.php?absolute_dl=true&' .
- "passed_id=$id&mailbox=" . urlencode($mailbox) .
- '&ent_id=' . $linkurl . $quotchar;
+ "passed_id=$id&mailbox=" . urlencode($mailbox) .
+ '&ent_id=' . $linkurl . $quotchar;
+ } else {
+ /**
+ * If we couldn't generate a proper img url, drop in a blank image
+ * instead of sending back empty, otherwise it causes unusual behaviour
+ */
+ $httpurl = $quotchar . SM_PATH . 'images/blank.png';
}
+
return $httpurl;
}
"img",
"br",
"hr",
- "input"
+ "input",
+ "outbind"
);
$force_tag_closing = true;
if (preg_match("|$secremoveimg|i", $trusted)){
$has_unsafe_images = true;
}
+
+
+ // we want to parse mailto's and other URLs in HTML output too
+ parseUrl($trusted);
+
return $trusted;
}
} // end fn SendDownloadHeaders
-?>
\ No newline at end of file
+?>