// 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);
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 ) {
$k++;
}
if ( $base <> '' )
+
$ret = "<base href=\"$base\">" . $ret;
}
} else if (ereg('"([^"]*)"', $topline, $regs)) {
_("Message:") . " $message<BR>" .
_("FETCH line:") . " $topline<BR></tt></font></b>";
- 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);
$sid = sqimap_session_id();
// Don't kill the connection if the browser is over a dialup
// and it would take over 30 seconds to download it.
- set_time_limit(0);
+
+ // donĀ“t call set_time_limit in safe mode.
+ if (!ini_get("safe_mode")) {
+ set_time_limit(0);
+ }
fputs ($imap_stream, "$sid FETCH $id BODY[$ent_id]\r\n");
$cnt = 0;
function decodeHeader ($string, $utfencode=true) {
if (eregi('=\\?([^?]+)\\?(q|b)\\?([^?]+)\\?=',
$string, $res)) {
- if (ucfirst($res[2]) == "B") {
+ if (ucfirst($res[2]) == 'B') {
$replace = base64_decode($res[3]);
} else {
- $replace = ereg_replace("_", " ", $res[3]);
+ $replace = str_replace('_', ' ', $res[3]);
// Convert lowercase Quoted Printable to uppercase for
// quoted_printable_decode to understand it.
while (ereg("(=(([0-9][abcdef])|([abcdef][0-9])|([abcdef][abcdef])))", $replace, $res)) {
*/
function MagicHTML( $body, $id ) {
- global $message, $PHP_SELF, $HTTP_SERVER_VARS;
+ global $message, $HTTP_SERVER_VARS,
+ $attachment_common_show_images;
+ $attachment_common_show_images =
+ FALSE; // Don't display attached images in HTML mode
$j = strlen( $body ); // Legnth of the HTML
$ret = ''; // Returned string
$bgcolor = '#ffffff'; // Background style color (defaults to white)
return( "\n\n<!-- HTML Output ahead -->\n" .
$ret .
"\n<!-- END of HTML Output --><base href=\"".
- $HTTP_SERVER_VARS["SERVER_NAME"] . substr( $PHP_SELF, 0, strlen( $PHP_SELF ) - 13 ) .
+ get_location() . '/'.
"\">\n\n" );
}
$src = '../images/' . _("sec_remove_eng.png");
}
$ret .= 'src="' . $src . '" ';
- $i = $k-1;
+ $i = $k - 3;
} else {
$ret .= 'src';
$i = $i + 3;
return( $ret );
}
-?>
\ No newline at end of file
+?>