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.');