diff --git a/felamimail/inc/class.bofelamimail.inc.php b/felamimail/inc/class.bofelamimail.inc.php index 0f5cc859ad..25d13e018e 100644 --- a/felamimail/inc/class.bofelamimail.inc.php +++ b/felamimail/inc/class.bofelamimail.inc.php @@ -870,7 +870,7 @@ $kses->AddHTML( "a", array( - "href" => array('maxlen' => 145, 'minlen' => 10), + "href" => array('maxlen' => 348, 'minlen' => 10), "name" => array('minlen' => 2), 'target' => array('maxlen' => 10) ) @@ -959,7 +959,7 @@ $kses->AddHTML( 'img',array( - "src" => array("minlen" => 4, 'maxlen' => 200, $GLOBALS['egw_info']['user']['preferences']['felamimail']['allowExternalIMGs'] ? '' : 'match' => '/^cid:.*/'), + "src" => array("minlen" => 4, 'maxlen' => 384, $GLOBALS['egw_info']['user']['preferences']['felamimail']['allowExternalIMGs'] ? '' : 'match' => '/^cid:.*/'), "align" => array("minlen" => 1), "border" => array('maxlen' => 30), ) @@ -1533,7 +1533,9 @@ $partHTML = $mimePart; } elseif ($mimePart->type == 'MULTIPART' && $mimePart->subType == 'RELATED' && is_array($mimePart->subParts)) { // in a multipart alternative we treat the multipart/related as html part - $partHTML = array($mimePart); + #$partHTML = array($mimePart); + error_log(__METHOD__." process MULTIPART/RELATED with array as subparts"); + $partHTML = $mimePart; } } @@ -1584,8 +1586,10 @@ { if (self::$debug) echo __METHOD__."$_uid, $_htmlMode
"; $bodyPart = array(); - if (self::$debug) _debug_array($_structure); + if (self::$debug) _debug_array($_structure); + if (!is_array($_structure)) $_structure = array($_structure); foreach($_structure as $part) { + if (self::$debug) echo $part->type."/".$part->subType."
"; switch($part->type) { case 'MULTIPART': switch($part->subType) { @@ -1642,9 +1646,10 @@ function getTextPart($_uid, $_structure, $_htmlMode = '') { $bodyPart = array(); - + #_debug_array($_structure); $partID = $_structure->partID; $mimePartBody = $this->icServer->getBodyPart($_uid, $partID, true); + #_debug_array($mimePartBody); #_debug_array(preg_replace('/PropertyFile___$/','',$this->decodeMimePart($mimePartBody, $_structure->encoding))); if($_structure->subType == 'HTML' && $_htmlMode != 'always_display' && $_htmlMode != 'only_if_no_text') { $bodyPart = array( diff --git a/felamimail/inc/class.uidisplay.inc.php b/felamimail/inc/class.uidisplay.inc.php index 3ba498218f..850078b015 100644 --- a/felamimail/inc/class.uidisplay.inc.php +++ b/felamimail/inc/class.uidisplay.inc.php @@ -961,6 +961,7 @@ #_debug_array($bodyParts); exit; foreach($bodyParts as $singleBodyPart) { + if (!isset($singleBodyPart['body'])) $singleBodyPart['body'] = $this->getdisplayableBody($singleBodyPart); if(!empty($body)) { $body .= '
'; } @@ -1000,16 +1001,16 @@ // http://www.php.net/manual/en/function.preg-replace.php // create links for websites - $newBody = preg_replace("/((http(s?):\/\/)|(www\.))([\w,\-,\/,\?,\=,\.,&,!\n,!>,\%,@,\*,#,:,~,\+]+)/ie", - "'displayCharset\").'\" target=\"_blank\">$2$4$5'", $newBody); + #$newBody = preg_replace("/((http(s?):\/\/)|(www\.))([\w,\-,\/,\?,\=,\.,&,!\n,!>,\%,@,\*,#,:,~,\+]+)/ie", + # "'displayCharset\"). + # '\" target=\"_blank\">$2$4$5'", $newBody); // create links for ftp sites - $newBody = preg_replace("/((ftp:\/\/)|(ftp\.))([\w\.,-.,\/.,\?.,\=.,&]+)/i", - "ftp://$3$4", $newBody); - + #$newBody = preg_replace("/((ftp:\/\/)|(ftp\.))([\w\.,-.,\/.,\?.,\=.,&]+)/i", + # "ftp://$3$4", $newBody); + $newBody = html::activate_links($newBody); // create links for email addresses $this->parseEmail($newBody); - $newBody = $this->highlightQuotes($newBody); // to display a mailpart of mimetype plain/text, may be better taged as preformatted #$newBody = nl2br($newBody); @@ -1024,18 +1025,17 @@ #error_log(print_r($newBody,true)); bofelamimail::getCleanHTML($newBody); // create links for websites - #$newBody = preg_replace("/(?)((http(s?):\/\/)|(www\.))([\w,\-,\/,\?,\=,\.,&,!\n,\%,@,\*,#,:,~,\+]+)/ie", - # "'displayCharset\").'\" target=\"_blank\">$2$4$5'", $newBody); - $newBody = preg_replace("/(?|\/|\")((http(s?):\/\/)|(www\.))([\w,\-,\/,\?,\=,\.,&,!\n,\%,@,\*,#,:,~,\+]+)/ie", - "'displayCharset\").'\" target=\"_blank\">$2$4$5'", $newBody); + #$newBody = preg_replace("/(?|\/|\"|href='|href=\")((http(s?):\/\/)|(www\.))([\w,\-,\/,\?,\=,\.,&,!\n,\%,@,\*,#,:,~,\+]+)/ie", + # "'displayCharset\"). + # '\" target=\"_blank\">$2$4$5'", $newBody); // create links for websites - $newBody = preg_replace("/href=(\"|\')((http(s?):\/\/)|(www\.))([\w,\-,\/,\?,\=,\.,&,!\n,\%,@,\(,\),\*,#,:,~,\+]+)(\"|\')/ie", - "'href=\"$webserverURL/redirect.php?go='.@htmlentities(urlencode('http$4://$5$6'),ENT_QUOTES,\"$this->displayCharset\").'\" target=\"_blank\"'", $newBody); - + #$newBody = preg_replace("/href=(\"|\')((http(s?):\/\/)|(www\.))([\w,\-,\/,\?,\=,\.,&,!\n,\%,@,\(,\),\*,#,:,~,\+]+)(\"|\')/ie", + # "'href=\"$webserverURL/redirect.php?go='.@htmlentities(urlencode('http$4://$5$6'),ENT_QUOTES,\"$this->displayCharset\").'\" target=\"_blank\"'", $newBody); + $newBody = html::activate_links($newBody); // create links for ftp sites - $newBody = preg_replace("/href=(\"|\')((ftp:\/\/)|(ftp\.))([\w\.,-.,\/.,\?.,\=.,&]+)(\"|\')/i", - "href=\"ftp://$4$5\" target=\"_blank\"", $newBody); + #$newBody = preg_replace("/href=(\"|\')((ftp:\/\/)|(ftp\.))([\w\.,-.,\/.,\?.,\=.,&]+)(\"|\')/i", + # "href=\"ftp://$4$5\" target=\"_blank\"", $newBody); // create links for inline images $linkData = array (