[Fusionforge-commits] r15687 - in trunk: . src/common/docman

Roland Mas lolando at fusionforge.org
Fri Jun 8 14:16:25 CEST 2012


Author: lolando
Date: 2012-06-08 14:16:25 +0200 (Fri, 08 Jun 2012)
New Revision: 15687

Modified:
   trunk/
   trunk/src/common/docman/Document.class.php
Log:
Clamp document size to zero if it can't be calculated

Modified: trunk/src/common/docman/Document.class.php
===================================================================
--- trunk/src/common/docman/Document.class.php	2012-06-08 09:56:35 UTC (rev 15686)
+++ trunk/src/common/docman/Document.class.php	2012-06-08 12:16:25 UTC (rev 15687)
@@ -153,6 +153,9 @@
 			$data = mb_convert_encoding($data, 'UTF-8', mb_detect_encoding($data));
 		}
 
+                $filesize = filesize($data);
+                if (!$filesize) { $filesize = 0 ; }
+
 		// key words for in-document search
 		if ($this->Group->useDocmanSearch()) {
 			$kw = new Parsedata();
@@ -173,7 +176,7 @@
 							$doc_initstatus,
 							$filename,
 							$filetype,
-							filesize($data),
+							$filesize,
 							$kwords,
 							$user_id)
 					);




More information about the Fusionforge-commits mailing list