[BUGFIX] Localisation update doesn't work
authorSebastian Fischer <typo3@evoweb.de>
Sat, 14 Apr 2012 10:01:32 +0000 (12:01 +0200)
committerStefan Galinski <stefan.galinski@gmail.com>
Sat, 14 Apr 2012 22:16:08 +0000 (00:16 +0200)
Change-Id: I3353dfa5425fab87186dfbb9174bc71ec0acee86
Fixes: #36027
Releases: 6.0, 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/10520
Reviewed-by: Stefan Galinski
Tested-by: Stefan Galinski
typo3/sysext/em/classes/connection/class.tx_em_connection_ter.php

index 7328f55..ead157c 100644 (file)
@@ -109,12 +109,15 @@ class tx_em_Connection_Ter {
        function updateTranslation($extKey, $lang, $mirrorURL) {
                $l10n = $this->fetchTranslation($extKey, $lang, $mirrorURL);
                if (is_array($l10n)) {
-                       $file = PATH_site . 'typo3temp/' . $extKey . '-l10n-' . $lang . '.zip';
-                       $path = 'l10n/' . $lang . '/';
+                       $file = PATH_site . 'typo3temp' . DIRECTORY_SEPARATOR . $extKey . '-l10n-' . $lang . '.zip';
+                       $path = 'l10n' . DIRECTORY_SEPARATOR . $lang . DIRECTORY_SEPARATOR;
                        if (!is_dir(PATH_typo3conf . $path)) {
                                t3lib_div::mkdir_deep(PATH_typo3conf, $path);
                        }
                        t3lib_div::writeFile($file, $l10n[0]);
+
+                       t3lib_div::rmdir(PATH_typo3conf . $path . $extKey, TRUE);
+
                        if (tx_em_Tools::unzip($file, PATH_typo3conf . $path)) {
                                return TRUE;
                        }
@@ -374,4 +377,4 @@ class tx_em_Connection_Ter {
 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/sysext/em/classes/connection/class.tx_em_connection_ter.php'])) {
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/sysext/em/classes/connection/class.tx_em_connection_ter.php']);
 }
-?>
\ No newline at end of file
+?>