Issue Bug Closed

#53740Extension ZIP Upload doesn't extract directories on Windows

Alexander Buchholtz 11/18/13, 18:25 updated 10/02/18, 12:08

Description

Step by Step

  1. Install Xampp 1.8.2 for Windows
  2. Install TYPO3 6.1.5 Introduction Package
  3. Manually download any extension in ZIP-format from TER that has sub-directories e.g. http://typo3.org/extensions/repository/download/l10nmgr/3.4.0/zip/
  4. Log in TYPO3 as administrator
  5. Go to Extension Manager
  6. Click on “Upload extension .t3x/.zip” button
  7. Select the previously downloaded ZIP archive
  8. Verify that a message appears confirming the successful installation
  9. Verify in the local file system that the sub-directories contained in the ZIP archive are not extracted at /typo3conf/ext/l10nmgr/
  10. Verify in the TYPO3 logs that all directories and files contained in these directories are reported as an error, e.g.: Core: Error handler (BE): PHP Warning: fopen(C:/xampp/htdocs/typo3/typo3conf/ext/l10nmgr/views/class.tx_l10nmgr_l10nHTMLListView.php): failed to open stream: No such file or directory in C:\xampp\htdocs\typo3\typo3\sysext\core\Classes\Utility\GeneralUtility.php line 2472

The issue was already reported on the dev list (http://lists.typo3.org/pipermail/typo3-dev/2013-November/047680.html) as well as a comment by Lukas Schnabel in issue #52178

My OS: Windows 7 SP1

The problem lies in TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility.php:411
if (strpos(zip_entry_name($zipEntry), DIRECTORY_SEPARATOR) !== FALSE) {

where the zip entry name is returned with a forward slash as where the DIRECTORY SEPARATOR is set by PHP to a backslash. Therefore the sub-directories are never created and writing the files fails with an error.

Thanks,
Alexander

Reviews 1