[BUGFIX] Fix extraction path of language packs in LanguagePackService 77/56577/6
authorJoshua Westerheide <dev@jdoubleu.de>
Fri, 6 Apr 2018 08:51:30 +0000 (10:51 +0200)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Fri, 6 Apr 2018 11:50:25 +0000 (13:50 +0200)
Due to the appended extension key an invalid directory structure was
created. The language pack ".zip" files already contain extension
directories.

Resolves: #84638
Releases: master
Related: #84131
Change-Id: I19d4fa418a5c09a88fb814fb0780e122655a24b0
Reviewed-on: https://review.typo3.org/56577
Reviewed-by: Tim Schreiner <schreiner.tim@gmail.com>
Tested-by: Tim Schreiner <schreiner.tim@gmail.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
typo3/sysext/install/Classes/Service/LanguagePackService.php

index f19df56..002a8e1 100644 (file)
@@ -234,7 +234,8 @@ class LanguagePackService
             $packageUrl = $key[0] . '/' . $key[1] . '/' . $key . '-l10n/' . $key . '-l10n-' . $iso . '.zip';
         }
 
-        $absoluteExtractionPath = GeneralUtility::getFileAbsFileName('typo3conf/l10n/' . $iso . '/' . $key . '/');
+        $absoluteLanguagePath = GeneralUtility::getFileAbsFileName('typo3conf/l10n/' . $iso . '/');
+        $absoluteExtractionPath = $absoluteLanguagePath . $key . '/';
         $absolutePathToZipFile = Environment::getVarPath() . '/transient/' . $key . '-l10n-' . $iso . '.zip';
 
         $packExists = is_dir($absoluteExtractionPath);
@@ -253,7 +254,7 @@ class LanguagePackService
                     GeneralUtility::mkdir_deep(Environment::getVarPath() . '/transient/');
                     $operationResult = GeneralUtility::writeFileToTypo3tempDir($absolutePathToZipFile, $languagePackContent) === null;
                 }
-                $this->unzipTranslationFile($absolutePathToZipFile, $absoluteExtractionPath);
+                $this->unzipTranslationFile($absolutePathToZipFile, $absoluteLanguagePath);
                 if ($operationResult) {
                     $operationResult = unlink($absolutePathToZipFile);
                 }