return $rsl;
case "subject":
- $link = null;
$text = stripslashes($text);
- if (function_exists('hook_getSubject')) {
- $link = hook_getSubject($text);
- }
- return banana_catchFormats($text) . $link;
+ $text = html_entities($text);
+ return banana_catchFormats($text);
default:
return $text;
exit;
}
- public function getFormattedBody($type = null)
+ public function getFormattedBody(&$reqtype = null)
{
$types = Banana::$msgshow_mimeparts;
- if (!is_null($type)) {
- array_unshift($types, $type);
+ if (!is_null($reqtype)) {
+ array_unshift($types, $reqtype);
}
foreach ($types as $type) {
@list($type, $subtype) = explode('/', $type);
if (empty($parts)) {
continue;
}
- foreach ($parts as &$part) {
- list($type, $subtype) = $part->getType();
- switch ($subtype) {
- case 'html': return banana_formatHtml($part);
- case 'enriched': case 'richtext': return banana_formatRichText($part);
- default: return banana_formatPlainText($part);
- }
- }
+ $reqtype = implode('/', $parts[0]->getType());
+ return $parts[0]->toHtml();
}
return null;
}
public function quote()
{
- $part = $this->toPlainText();
- if (is_null($part)) {
- return banana_quoteHtml($this->toHtml());
+ foreach (Banana::$msgedit_mimeparts as $type) {
+ @list($type, $subtype) = explode('/', $type);
+ $parts = $this->getParts($type, $subtype);
+ if (empty($parts)) {
+ continue;
+ }
+ if ($parts[0] === $this) {
+ return parent::quote();
+ }
+ return $parts[0]->quote();
}
- return banana_quotePlainText($part);
+ return null;
}
public function canCancel()