From 7734cab580b962b7d3e2a1532f036cd2faec62b2 Mon Sep 17 00:00:00 2001 From: Ricky Elrod Date: Fri, 10 Jun 2011 14:52:11 -0400 Subject: [PATCH] Fix pastebin mimetypes. Summary: PhabricatorFile() was setting the mimetype based on extension, meaning that you couldn't view the plain-text file if you saved a file, for example, as a .php. It would set the mimetype to "text/x-php; charset=us-ascii". In this commit, I force the mimetype to text/plain. Test Plan: Tried pasting a new file and was able to both see it via the pastebin viewer and in plain-text via File. Reviewers: epriestley CC: Differential Revision: 429 --- .../paste/controller/create/PhabricatorPasteCreateController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/applications/paste/controller/create/PhabricatorPasteCreateController.php b/src/applications/paste/controller/create/PhabricatorPasteCreateController.php index 4b4a5be54c..36b25fab2c 100644 --- a/src/applications/paste/controller/create/PhabricatorPasteCreateController.php +++ b/src/applications/paste/controller/create/PhabricatorPasteCreateController.php @@ -46,6 +46,7 @@ class PhabricatorPasteCreateController extends PhabricatorPasteController { $text, array( 'name' => $title, + 'mime-type' => 'text/plain; charset=utf-8', )); $paste->setFilePHID($paste_file->getPHID()); $paste->setAuthorPHID($user->getPHID());