[Fusionforge-commits] r15460 - branches/Branch_5_1/src/common/docman/include
Franck VILLAUME
nerville at fusionforge.org
Sat May 5 13:22:36 CEST 2012
Author: nerville
Date: 2012-05-05 13:22:35 +0200 (Sat, 05 May 2012)
New Revision: 15460
Modified:
branches/Branch_5_1/src/common/docman/include/utils.php
Log:
fix encoding in dirname and filename due to ZipArchive limitations
Modified: branches/Branch_5_1/src/common/docman/include/utils.php
===================================================================
--- branches/Branch_5_1/src/common/docman/include/utils.php 2012-05-05 10:51:00 UTC (rev 15459)
+++ branches/Branch_5_1/src/common/docman/include/utils.php 2012-05-05 11:22:35 UTC (rev 15460)
@@ -7,6 +7,7 @@
* Copyright 2002-2004, GForge Team
* Copyright 2010, Franck Villaume - Capgemini
* Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
+ * Copyright 2012, Franck Villaume - TrivialDev
* http://fusionforge.org
*
* This file is part of FusionForge. FusionForge is free software;
@@ -79,7 +80,7 @@
}
}
-/*
+/**
* docman_fill_zip - Recursive function to add docgroup and documents inside zip for backup
*
* @param $object zip
@@ -91,18 +92,18 @@
function docman_fill_zip($zip, $nested_groups, $document_factory, $docgroup = 0, $parent_docname = '') {
if (is_array(@$nested_groups[$docgroup])) {
foreach ($nested_groups[$docgroup] as $dg) {
- if (!$zip->addEmptyDir($parent_docname.'/'.$dg->getName()))
+ if (!$zip->addEmptyDir(iconv("UTF-8", "ASCII//TRANSLIT", $parent_docname).'/'.iconv("UTF-8", "ASCII//TRANSLIT", $dg->getName())))
return false;
$document_factory->setDocGroupID($dg->getID());
$docs = $document_factory->getDocuments();
if (is_array($docs) && count($docs) > 0) { // this group has documents
foreach ($docs as $doc) {
- if ( !$zip->addFromString($parent_docname.'/'.$dg->getName().'/'.$doc->getFileName(),$doc->getFileData()))
+ if (!$zip->addFromString(iconv("UTF-8", "ASCII//TRANSLIT", $parent_docname).'/'.iconv("UTF-8", "ASCII//TRANSLIT", $dg->getName()).'/'.iconv("UTF-8", "ASCII//TRANSLIT", $doc->getFileName()), $doc->getFileData()))
return false;
}
}
- docman_fill_zip($zip, $nested_groups, $document_factory, $dg->getID(), $parent_docname.'/'.$dg->getName());
+ docman_fill_zip($zip, $nested_groups, $document_factory, $dg->getID(), iconv("UTF-8", "ASCII//TRANSLIT", $parent_docname).'/'.iconv("UTF-8", "ASCII//TRANSLIT", $dg->getName()));
}
}
return true;
More information about the Fusionforge-commits
mailing list