[evolvis-commits] r15772: Display attachement inline if .txt for forums.

mirabilos at evolvis.org mirabilos at evolvis.org
Tue Mar 1 00:28:40 CET 2011


Author: mirabilos
Date: 2011-03-01 00:28:40 +0100 (Tue, 01 Mar 2011)
New Revision: 15772

Modified:
   trunk/gforge_base/evolvisforge-5.1/src/www/forum/attachment.php
Log:
Display attachement inline if .txt for forums.

Modified: trunk/gforge_base/evolvisforge-5.1/src/www/forum/attachment.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/forum/attachment.php	2011-02-28 23:28:36 UTC (rev 15771)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/forum/attachment.php	2011-02-28 23:28:40 UTC (rev 15772)
@@ -201,7 +201,13 @@
 header('Last-Modified: ' . $last . ' GMT');
 header('ETag: "' . db_result($res,0,'attachmentid') . '"');
 
-header('Content-disposition: attachment; filename="' . db_result($res,0,'filename') . '"');
+if ($extension != 'txt') {
+	header("Content-disposition: inline; filename=\"" . db_result($res,0,'filename') . "\"");
+	header('Content-transfer-encoding: binary');
+}	else {
+	header("Content-disposition: attachment; filename=\"" . db_result($res,0,'filename') . "\"");
+}
+
 header('Content-Length: ' . db_result($res,0,'filesize') );
 
 



More information about the evolvis-commits mailing list