summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpabs <pabs@pablotron.org>2008-10-23 14:58:32 -0400
committerpabs <pabs@pablotron.org>2008-10-23 14:58:32 -0400
commit76bbbcf5deffb2d526502a807d27bbbfb90b7f12 (patch)
treead4d738438cf1998590ced2f2ec6718b7c6cae7d
parente337ceea5a45d0d28a0ff6a8ef3c22cf56b864c2 (diff)
downloadzipstream-php-76bbbcf5deffb2d526502a807d27bbbfb90b7f12.tar.bz2
zipstream-php-76bbbcf5deffb2d526502a807d27bbbfb90b7f12.zip
add workaround for windows archive viewer bug (fixes #34)
-rw-r--r--zipstream.php5
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);