From e52760e47e3268637d44e997321184d16263c8ef Mon Sep 17 00:00:00 2001 From: Luke Cousins Date: Wed, 17 May 2017 21:21:07 +0100 Subject: [PATCH] Bug fix for #133 (correcting file_exists path) --- src/Adapter/ZipExtensionAdapter.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Adapter/ZipExtensionAdapter.php b/src/Adapter/ZipExtensionAdapter.php index d299729..4c1e3ce 100644 --- a/src/Adapter/ZipExtensionAdapter.php +++ b/src/Adapter/ZipExtensionAdapter.php @@ -126,7 +126,8 @@ protected function doExtractMembers(ResourceInterface $resource, $members, $to, } if ($overwrite == false) { - if (file_exists($member)) { + $fileToCheck = ($to != '' && substr($to, 0, -1) != DIRECTORY_SEPARATOR ? $to.DIRECTORY_SEPARATOR : $to) . $member; + if (file_exists($fileToCheck)) { $resource->getResource()->close(); throw new RuntimeException('Target file ' . $member . ' already exists.');