diff --git a/lib/attachmentlistitem.php b/lib/attachmentlistitem.php index 6b8df0dd39..8c637d28df 100644 --- a/lib/attachmentlistitem.php +++ b/lib/attachmentlistitem.php @@ -159,7 +159,7 @@ class AttachmentListItem extends Widget break; case 'text/html': - if ($this->attachment->filename) { + if (!empty($this->attachment->filename) && common_config('attachments', 'show_html')) { // Locally-uploaded HTML. Scrub and display inline. $this->showHtmlFile($this->attachment); break; diff --git a/lib/default.php b/lib/default.php index f725d7719b..dc7a005339 100644 --- a/lib/default.php +++ b/lib/default.php @@ -249,6 +249,7 @@ $default = 'user_quota' => 50000000, 'monthly_quota' => 15000000, 'uploads' => true, + 'show_html' => false, // HTML representation for locally uploaded HTML attachments (oEmbed links etc.) 'show_thumbs' => true, // show thumbnails in notice lists for uploaded images, and photos and videos linked remotely that provide oEmbed info 'process_links' => true, // check linked resources for embeddable photos and videos; this will hit referenced external web sites when processing new messages. ), diff --git a/plugins/Oembed/OembedPlugin.php b/plugins/Oembed/OembedPlugin.php index 27f299b5eb..5413ae94cd 100644 --- a/plugins/Oembed/OembedPlugin.php +++ b/plugins/Oembed/OembedPlugin.php @@ -160,7 +160,7 @@ class OembedPlugin extends Plugin case 'rich': case 'video': case 'link': - if (!empty($oembed->html)) { + if (!empty($oembed->html) && common_config('attachments', 'show_html')) { require_once INSTALLDIR.'/extlib/htmLawed/htmLawed.php'; $config = array( 'safe'=>1,