]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Don't show or preview text/html attachments
authorMikael Nordfeldth <mmn@hethane.se>
Sun, 18 May 2014 21:11:22 +0000 (23:11 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sun, 18 May 2014 21:11:49 +0000 (23:11 +0200)
htmLawed cleans stuff out properly, but there's no very good way right
now to show text/html attachments, since everything gets jumbled up with
our own CSS etc. Best would be an iframe or just a new tab or so.

lib/attachmentlistitem.php
lib/default.php
plugins/Oembed/OembedPlugin.php

index 6b8df0dd3962537cfbcd7bd20bffdf99ecff9fa5..8c637d28df895a624a43b1a5ae007e07f940921c 100644 (file)
@@ -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;
index f725d7719be0d569531626c0e40dd4f635af48b5..dc7a005339deb794c9fae7eadb1cdb75d9d60e2e 100644 (file)
@@ -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.
               ),
index 27f299b5ebf454f44a0b766ba945a179a1c6b46b..5413ae94cd6cc3868536a35fb952763934c93900 100644 (file)
@@ -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,