Don't show or preview text/html attachments

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.
This commit is contained in:
Mikael Nordfeldth 2014-05-18 23:11:22 +02:00
parent b0cc9292b1
commit c93a5252c1
3 changed files with 3 additions and 2 deletions

View File

@ -159,7 +159,7 @@ class AttachmentListItem extends Widget
break; break;
case 'text/html': case 'text/html':
if ($this->attachment->filename) { if (!empty($this->attachment->filename) && common_config('attachments', 'show_html')) {
// Locally-uploaded HTML. Scrub and display inline. // Locally-uploaded HTML. Scrub and display inline.
$this->showHtmlFile($this->attachment); $this->showHtmlFile($this->attachment);
break; break;

View File

@ -249,6 +249,7 @@ $default =
'user_quota' => 50000000, 'user_quota' => 50000000,
'monthly_quota' => 15000000, 'monthly_quota' => 15000000,
'uploads' => true, '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 '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. 'process_links' => true, // check linked resources for embeddable photos and videos; this will hit referenced external web sites when processing new messages.
), ),

View File

@ -160,7 +160,7 @@ class OembedPlugin extends Plugin
case 'rich': case 'rich':
case 'video': case 'video':
case 'link': case 'link':
if (!empty($oembed->html)) { if (!empty($oembed->html) && common_config('attachments', 'show_html')) {
require_once INSTALLDIR.'/extlib/htmLawed/htmLawed.php'; require_once INSTALLDIR.'/extlib/htmLawed/htmLawed.php';
$config = array( $config = array(
'safe'=>1, 'safe'=>1,