Jump to content

e11j4y

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Everything posted by e11j4y

  1. Just to make sure I understand, are you confirming that there's no way to archive files that contain \n line endings on Windows using PECL Zip without first modifying the line endings to \r\n? Thanks.
  2. On Windows, the PECL ZIP extension module (ZipArchive class) appears to create invalid .zip archives when compressing files that contain '\n' line endings. Doing something simple like this: $zip = new ZipArchive(); $filename = "./test.zip"; if ($zip->open($filename, ZIPARCHIVE::CREATE)===TRUE) {   $zip->addFile("test.txt","text.txt");   $zip->close(); } where test.txt contains '\n' line endings results in a .zip archive that isn't valid, ie it cannot be opened using tools like WinZip. However, when test.txt contains '\r\n' line endings, the archive created is valid and can be opened without error. If the files to be archived are mixed -- some with '\n' endings and some with '\r\n' -- the resulting archive can be opened, however those files with '\r\n' endgins can't be extracted. Has anyone else observed this? Any suggestions for a workaround (apart from modifying the line endings of the files to be archived)? There seems to be a similar bug here [url=http://pecl.php.net/bugs/bug.php?id=8711]http://pecl.php.net/bugs/bug.php?id=8711[/url], however I'm not sure it's quite the same problem. I've tried: . setting auto_detect_line_endings to 'On'. . using ZIPARCHIVE::OVERWRITE instead of ZIPARCHIVE::CREATE. This is on: - Zip version 2.0.0, Libzip version 0.7.1 - PHP 5.2.0 (Built Oct 03, 2006) - Apache 2.0.52 - Windows XP Pro
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.