Fix detection of HTML mime parts in Email::debugDump()
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 3 Mar 2022 13:09:28 +0000 (14:09 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 3 Mar 2022 13:33:20 +0000 (14:33 +0100)
wcfsetup/install/files/lib/system/email/Email.class.php

index 5005620a6c041058e46cc5ecee4302dbab42939e..cfd46737e5ff85906640d8ad4e2b4db95abfca54 100644 (file)
@@ -774,9 +774,9 @@ class Email
                     $result .= $dumpBody($part, $depth + 1);
                 }
                 $result .= '</fieldset>';
-            } elseif ($body instanceof mime\RecipientAwareTextMimePart) {
+            } elseif ($body instanceof mime\TextMimePart) {
                 $result .= "<fieldset><legend><h" . $depth . ">" . \get_class($body) . "</h" . $depth . "></legend>";
-                if ($body instanceof mime\HtmlTextMimePart) {
+                if (\str_starts_with($body->getContentType(), 'text/html')) {
                     $result .= '<iframe src="data:text/html;base64,' . \base64_encode($body->getContent()) . '" style="width: 100%; height: 500px; border: 0"></iframe>';
                 } else {
                     $result .= "<pre>" . StringUtil::encodeHTML($body->getContent()) . "</pre>";