Can configure spool root
[banana.git] / banana / message.inc.php
index 17fcf5c..01686a1 100644 (file)
@@ -108,6 +108,7 @@ final class BananaMessage extends BananaMimePart
 
           case "subject":
             $text = stripslashes($text);
+            $text = html_entities($text);
             return banana_catchFormats($text);
 
           default:
@@ -227,11 +228,11 @@ final class BananaMessage extends BananaMimePart
         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);
@@ -239,6 +240,7 @@ final class BananaMessage extends BananaMimePart
             if (empty($parts)) {
                 continue;
             }
+            $reqtype = implode('/', $parts[0]->getType());
             return $parts[0]->toHtml();
         }
         return null;