diff options
author | pabs <pabs@pablotron.org> | 2008-10-23 14:58:32 -0400 |
---|---|---|
committer | pabs <pabs@pablotron.org> | 2008-10-23 14:58:32 -0400 |
commit | 76bbbcf5deffb2d526502a807d27bbbfb90b7f12 (patch) | |
tree | ad4d738438cf1998590ced2f2ec6718b7c6cae7d /zipstream.php | |
parent | e337ceea5a45d0d28a0ff6a8ef3c22cf56b864c2 (diff) | |
download | zipstream-php-76bbbcf5deffb2d526502a807d27bbbfb90b7f12.tar.bz2 zipstream-php-76bbbcf5deffb2d526502a807d27bbbfb90b7f12.zip |
add workaround for windows archive viewer bug (fixes #34)
Diffstat (limited to 'zipstream.php')
-rw-r--r-- | zipstream.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/zipstream.php b/zipstream.php index 1fe72dd..14d728f 100644 --- a/zipstream.php +++ b/zipstream.php @@ -281,6 +281,11 @@ 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 + # (fixes bug in windows archive viewer) + if ($name[0] == '/') + $name = substr($name, 1); + # calculate name length $nlen = strlen($name); |