From 0b7cc83ccb2a4d3450f6ff5c09b2a456b3dda2dc Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Sun, 2 Sep 2018 18:59:38 -0400 Subject: fix path checks --- src/ZipStream.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ZipStream.php b/src/ZipStream.php index a3a8313..6522803 100644 --- a/src/ZipStream.php +++ b/src/ZipStream.php @@ -1089,12 +1089,12 @@ final class Entry { } # check for leading slash - if (!$path[0] == '/') { + if ($path[0] == '/') { throw new PathError($path, "path contains leading slash"); } # check for trailing slash - if (preg_match('/\\$/', $path)) { + if (preg_match('/\/$/', $path)) { throw new PathError($path, "path contains trailing slash"); } -- cgit v1.2.3