From 7d209a1c58df14bcbc2b6028fa168c3f1c9b2569 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sat, 23 Jun 2012 17:31:04 +0100 Subject: [PATCH] Sanitising vars and working with new exclude var Cleaning vars with strClean function now Made a slight change to zipTgt to handle root with empty var Checks and only adds file to zip if it's not excluded --- plugins/zip-it/index.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/plugins/zip-it/index.php b/plugins/zip-it/index.php index b5645cf..a3fd8bd 100644 --- a/plugins/zip-it/index.php +++ b/plugins/zip-it/index.php @@ -1,29 +1,26 @@ - Zip It! for ICEcoder - open($zipName,ZIPARCHIVE::CREATE)!== true) {return false;} + $excludeFilesFolders = explode(",",strClean($_GET['exclude'])); foreach($zipFiles as $file) { - $zip->addFile($file,str_replace($_SERVER['DOCUMENT_ROOT']."/","",$file)); + $canAdd=true; + for ($i=0;$iaddFile($file,str_replace($_SERVER['DOCUMENT_ROOT']."/","",$file)); + } } $zip->close(); return file_exists($zipName); @@ -67,5 +71,4 @@ if($_SESSION['userLevel']==10) { } ?> - \ No newline at end of file