From d23ddb8f8a78fb62ea51d4cda889be8d2cfaa1b8 Mon Sep 17 00:00:00 2001
From: prasad <prasad@vtiger.com>
Date: Wed, 13 Jul 2016 15:22:59 +0530
Subject: [PATCH] Fixed syntax (assigning references) used in dZip and dUnzip
 for PHP 7 compat.

---
 vtlib/thirdparty/dUnzip2.inc.php | 4 ++--
 vtlib/thirdparty/dZip.inc.php    | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/vtlib/thirdparty/dUnzip2.inc.php b/vtlib/thirdparty/dUnzip2.inc.php
index 4769e5e66..8c1958a02 100644
--- a/vtlib/thirdparty/dUnzip2.inc.php
+++ b/vtlib/thirdparty/dUnzip2.inc.php
@@ -102,7 +102,7 @@ class dUnzip2{
 		
 		// Open file, and set file handler
 		$fh = fopen($this->fileName, "r");
-		$this->fh = &$fh;
+		$this->fh = $fh;
 		if(!$fh){
 			$this->debugMsg(2, "Failed to load file.");
 			return false;
@@ -198,7 +198,7 @@ class dUnzip2{
 			$this->getList(false, $compressedFileName);
 		}
 		
-		$fdetails = &$this->compressedList[$compressedFileName];
+		$fdetails = $this->compressedList[$compressedFileName];
 		if(!isset($this->compressedList[$compressedFileName])){
 			$this->debugMsg(2, "File '<b>$compressedFileName</b>' is not compressed in the zip.");
 			return false;
diff --git a/vtlib/thirdparty/dZip.inc.php b/vtlib/thirdparty/dZip.inc.php
index 3ca05cfb8..d4449a1ce 100644
--- a/vtlib/thirdparty/dZip.inc.php
+++ b/vtlib/thirdparty/dZip.inc.php
@@ -25,7 +25,7 @@ class dZip{
 		$this->addFile(false, $dirname, $fileComments);
 	}
 	Function addFile($filename, $cfilename, $fileComments='', $data=false){
-		if(!($fh = &$this->fh))
+		if(!($fh = $this->fh))
 			$fh = fopen($this->filename, $this->overwrite?'wb':'a+b');
 		
 		// $filename can be a local file OR the data wich will be compressed
@@ -51,7 +51,7 @@ class dZip{
 			$details['comsize'] = $details['uncsize'];
 			$details['vneeded'] = 10;
 			$details['cmethod'] = 0;
-			$zdata = &$data;
+			$zdata = $data;
 		}
 		else{ // otherwise, compress it
 			$zdata = gzcompress($data);
@@ -103,7 +103,7 @@ class dZip{
 		$this->centraldirs[$filename][$property] = $value;
 	}
 	Function save($zipComments=''){
-		if(!($fh = &$this->fh))
+		if(!($fh = $this->fh))
 			$fh = fopen($this->filename, $this->overwrite?'w':'a+');
 		
 		$cdrec = "";
-- 
GitLab