[Fusionforge-commits] FusionForge branch master updated. v6.0.3-390-gc94df70

Franck Villaume nerville at libremir.placard.fr.eu.org
Tue Mar 8 19:48:23 CET 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  c94df701d296276df516a4698375c7c89dd56b00 (commit)
      from  b45e833911a30b89b39d544480d9daa4643931b6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=c94df701d296276df516a4698375c7c89dd56b00

commit c94df701d296276df516a4698375c7c89dd56b00
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Tue Mar 8 19:47:59 2016 +0100

    docman: fix zip injection

diff --git a/src/common/docman/actions/injectzip.php b/src/common/docman/actions/injectzip.php
index 031e952..fd3a07d 100644
--- a/src/common/docman/actions/injectzip.php
+++ b/src/common/docman/actions/injectzip.php
@@ -3,7 +3,7 @@
  * FusionForge Documentation Manager
  *
  * Copyright 2010-2011, Franck Villaume - Capgemini
- * Copyright 2014,2015, Franck Villaume - TrivialDev
+ * Copyright 2014,2015-2016, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -39,9 +39,21 @@ if (!forge_check_perm('docman', $group_id, 'approve')) {
 }
 
 $uploaded_zip = getUploadedFile('uploaded_zip');
-$dg = documentgroup_get_object($dirid, $group_id);
+if (empty($uploaded_zip['name'])) {
+	$error_msg = _('Missing file or limit size exceeded');
+	session_redirect($return_url);
+}
 
-if (!$dg || $dg->isError() || !$dg->injectArchive($uploaded_zip)) {
+if ($dirid) {
+	$dg = documentgroup_get_object($dirid, $group_id);
+} else {
+	$dg = new DocumentGroup(group_get_object($group_id));
+}
+
+if (!$dg) {
+	$error_msg = _('No valid Group nor directory');
+	session_redirect($return_url);
+} elseif ($dg->isError() || !$dg->injectArchive($uploaded_zip)) {
 	$error_msg = $dg->getErrorMessage();
 	session_redirect($return_url);
 }

-----------------------------------------------------------------------

Summary of changes:
 src/common/docman/actions/injectzip.php | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list