[Fusionforge-commits] r12700 - branches/Branch_5_1/src/www/forum

Alain Peyrat aljeux at fusionforge.org
Fri Mar 11 18:11:19 CET 2011


Author: aljeux
Date: 2011-03-11 18:11:19 +0100 (Fri, 11 Mar 2011)
New Revision: 12700

Modified:
   branches/Branch_5_1/src/www/forum/attachment.php
Log:
Misc fixes in forum attachements

Modified: branches/Branch_5_1/src/www/forum/attachment.php
===================================================================
--- branches/Branch_5_1/src/www/forum/attachment.php	2011-03-11 17:11:09 UTC (rev 12699)
+++ branches/Branch_5_1/src/www/forum/attachment.php	2011-03-11 17:11:19 UTC (rev 12700)
@@ -4,6 +4,8 @@
  *
  * Portions Copyright 1999-2001 (c) VA Linux Systems
  * The rest Copyright 2002-2004 (c) GForge Team
+ * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
+ * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
  * http://fusionforge.org/
  *
  * This file is part of FusionForge.
@@ -184,19 +186,15 @@
 	$res = db_query_params ('SELECT * FROM forum_attachment WHERE attachmentid=$1',
 			array ($attachid));
 }
-if ( (!$res) ) {
+
+if (!$res || !db_numrows($res) ) {
 	exit_error("Attachment Download error: ".db_error(),'forums');
 }
 $extension = substr(strrchr(strtolower(db_result($res,0,'filename')), '.'), 1);
 
-if (!$extension) {
-	goodbye(_('The Attachment does not exist'));
-}
-
 $last = gmdate('D, d M Y H:i:s', db_result($res,0,'dateline'));
-header('X-Powered-By:');
 header('Last-Modified: ' . $last . ' GMT');
-header('ETag: "' . db_result($res,0,'attachmentid') . '"');
+header('ETag: "' . db_result($res,0,'attachmentid').db_result($res,0,'filehash') . '"');
 
 if ($extension != 'txt') {
 	header("Content-disposition: inline; filename=\"" . db_result($res,0,'filename') . "\"");




More information about the Fusionforge-commits mailing list