summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2018-09-02 18:59:38 -0400
committerPaul Duncan <pabs@pablotron.org>2018-09-03 09:54:47 -0400
commit0b7cc83ccb2a4d3450f6ff5c09b2a456b3dda2dc (patch)
treee6d739a2f5d2ccfd8a67f374d0f7dd167122e34d
parente4850cba6fd67a6d4d9d8c969281e57447c17fd9 (diff)
downloadzipstream-php-0b7cc83ccb2a4d3450f6ff5c09b2a456b3dda2dc.tar.bz2
zipstream-php-0b7cc83ccb2a4d3450f6ff5c09b2a456b3dda2dc.zip
fix path checks
-rw-r--r--src/ZipStream.php4
1 files changed, 2 insertions, 2 deletions
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");
}