From 11a3412e0f07f57a1fecf1b505a489c4db085447 Mon Sep 17 00:00:00 2001 From: pabs Date: Thu, 29 Jan 2009 13:19:16 -0500 Subject: second attempt at windows fixery --- zipstream.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'zipstream.php') 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); -- cgit v1.2.3