diff options
-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); |