]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/attachmentlistitem.php
Merge branch 'master' into mmn_fixes
[quix0rs-gnu-social.git] / lib / attachmentlistitem.php
index 291cf685d1d442b45fee357832ddc470fefc4483..6ee3c7087b43d5d573489974693ed89c8bfcf9fb 100644 (file)
@@ -171,6 +171,7 @@ class AttachmentListItem extends Widget
                     switch ($this->attachment->mimetype) {
                     case 'text/plain':
                         $this->element('div', ['class'=>'e-content plaintext'], file_get_contents($this->attachment->getPath()));
+                        break;
                     case 'text/html':
                         if (!empty($this->attachment->filename)
                                 && (GNUsocial::isAjax() || common_config('attachments', 'show_html'))) {
@@ -203,11 +204,7 @@ class AttachmentListItem extends Widget
      */
     protected function scrubHtmlFile(File $attachment)
     {
-        $path = File::path($attachment->filename);
-        if (!file_exists($path) || !is_readable($path)) {
-            common_log(LOG_ERR, "Missing local HTML attachment $path");
-            return false;
-        }
+        $path = $attachment->getPath();
         $raw = file_get_contents($path);
 
         // Normalize...