Bug #53346
closed
Extension upload as zip on Windows systems ignores directories
Added by Carsten (Aspagon) about 11 years ago.
Updated about 6 years ago.
Category:
Extension Manager
Description
If I click on "Upload Extension .t3x/.zip" in the extension manager on a windows system (Windows Vista, 32 bit, TYPO3 6.1.5) and upload a zip file, the Extension Manager ignories the directories. The extension directory contains only files after the upload.
The upload of t3x files works without problems.
The problem ist caused by the DIRECTORY_SEPARATOR in FileHandlingUtility.php, line 410ff.:
while (($zipEntry = zip_read($zip)) !== FALSE) {
if (strpos(zip_entry_name($zipEntry), DIRECTORY_SEPARATOR) !== FALSE) {
$last = strrpos(zip_entry_name($zipEntry), DIRECTORY_SEPARATOR);
$dir = substr(zip_entry_name($zipEntry), 0, $last);
$file = substr(zip_entry_name($zipEntry), strrpos(zip_entry_name($zipEntry), DIRECTORY_SEPARATOR) + 1);
...
"zip_entry_name($zipEntry)" returns for example "Classes/Controller/DummyController.php", but DIRECTORY_SEPARATOR returns "\" (Windows).
DIRECTORY_SEPARATOR should be replaced with '/'.
Please also take a look at: http://alanhogan.com/tips/php/directory-separator-not-necessary
- Status changed from New to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF