diff options
author | pabs <pabs@pablotron.org> | 2009-01-29 13:19:16 -0500 |
---|---|---|
committer | pabs <pabs@pablotron.org> | 2009-01-29 13:19:16 -0500 |
commit | 11a3412e0f07f57a1fecf1b505a489c4db085447 (patch) | |
tree | 42d5e10bffb6cff0dba1ac5d818b2193e8f36676 | |
parent | 76bbbcf5deffb2d526502a807d27bbbfb90b7f12 (diff) | |
download | zipstream-php-11a3412e0f07f57a1fecf1b505a489c4db085447.tar.bz2 zipstream-php-11a3412e0f07f57a1fecf1b505a489c4db085447.zip |
second attempt at windows fixery
-rw-r--r-- | zipstream.php | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/zipstream.php b/zipstream.php index 14d728f..e0790b6 100644 --- a/zipstream.php +++ b/zipstream.php @@ -281,10 +281,9 @@ class ZipStream { # Create and send zip header for this file. # function add_file_header($name, $opt, $meth, $crc, $zlen, $len) { - # strip leading slash from file name + # strip leading slashes from file name # (fixes bug in windows archive viewer) - if ($name[0] == '/') - $name = substr($name, 1); + $name = preg_replace('/^\\/+/', '', $name) # calculate name length $nlen = strlen($name); |