[TASK] Do not store files directly into typo3temp 34/42634/7
authorMarkus Klein <markus.klein@typo3.org>
Fri, 14 Aug 2015 21:13:23 +0000 (23:13 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Tue, 18 Aug 2015 16:04:28 +0000 (18:04 +0200)
Use a subfolder within typo3temp if files are meant to be persisted
there. Only allow Install Tool, UnitTests and temporary files for a
request to reside in the root typo3temp folder.

Resolves: #69078
Releases: master
Change-Id: I6202e84fefc7daff9dfcecb1c074d8e64de24718
Reviewed-on: http://review.typo3.org/42634
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
16 files changed:
typo3/sysext/backend/Classes/Controller/BackendController.php
typo3/sysext/backend/Classes/Utility/IconUtility.php
typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php
typo3/sysext/core/Classes/TypoScript/TemplateService.php
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-69078-TemplateService-tempPath.rst [new file with mode: 0644]
typo3/sysext/documentation/Classes/Service/DocumentationService.php
typo3/sysext/extensionmanager/Classes/Controller/ActionController.php
typo3/sysext/extensionmanager/Classes/Utility/FileHandlingUtility.php
typo3/sysext/extensionmanager/Classes/Utility/Repository/Helper.php
typo3/sysext/extensionmanager/Tests/Unit/Utility/FileHandlingUtilityTest.php
typo3/sysext/frontend/Classes/Page/PageGenerator.php
typo3/sysext/frontend/Tests/Unit/Controller/Fixtures/renderedPage.html
typo3/sysext/lang/Classes/Service/TerService.php
typo3/sysext/rtehtmlarea/Classes/Form/Element/RichTextElement.php
typo3/sysext/rtehtmlarea/Classes/RteHtmlAreaApi.php

index 60fbfd9..53b17ed 100644 (file)
@@ -445,7 +445,7 @@ class BackendController implements \TYPO3\CMS\Core\Http\ControllerInterface {
        }
 
        /**
-        * Returns the file name  to the LLL JavaScript, containing the localized labels,
+        * Returns the file name to the LLL JavaScript, containing the localized labels,
         * which can be used in JavaScript code.
         *
         * @return string File name of the JS file, relative to TYPO3_mainDir
@@ -453,11 +453,12 @@ class BackendController implements \TYPO3\CMS\Core\Http\ControllerInterface {
         */
        protected function getLocalLangFileName() {
                $code = $this->generateLocalLang();
-               $filePath = 'typo3temp/locallang-BE-' . sha1($code) . '.js';
-               if (!file_exists((PATH_site . $filePath))) {
+               $filePath = 'typo3temp/Language/Backend-' . sha1($code) . '.js';
+               if (!file_exists(PATH_site . $filePath)) {
                        // writeFileToTypo3tempDir() returns NULL on success (please double-read!)
-                       if (GeneralUtility::writeFileToTypo3tempDir(PATH_site . $filePath, $code) !== NULL) {
-                               throw new \RuntimeException('LocalLangFile could not be written to ' . $filePath, 1295193026);
+                       $error = GeneralUtility::writeFileToTypo3tempDir(PATH_site . $filePath, $code);
+                       if ($error !== NULL) {
+                               throw new \RuntimeException('Locallang JS file could not be written to ' . $filePath . '. Reason: ' . $error, 1295193026);
                        }
                }
                return '../' . $filePath;
index 3e57a49..66e119f 100644 (file)
@@ -361,11 +361,11 @@ class IconUtility {
         * @access private
         */
        static public function makeIcon($iconfile, $mode, $user, $protectSection, $absFile, $iconFileName_stateTagged) {
-               $iconFileName = 'icon_' . GeneralUtility::shortMD5(($iconfile . '|' . $mode . '|-' . $user . '|' . $protectSection)) . '_' . $iconFileName_stateTagged . '.' . ($GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib_png'] ? 'png' : 'gif');
-               $mainpath = '../typo3temp/' . $iconFileName;
-               $path = PATH_site . 'typo3temp/' . $iconFileName;
+               $iconFileName = GeneralUtility::shortMD5(($iconfile . '|' . $mode . '|-' . $user . '|' . $protectSection)) . '_' . $iconFileName_stateTagged . '.' . ($GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib_png'] ? 'png' : 'gif');
+               $mainpath = '../typo3temp/Icons/' . $iconFileName;
+               $path = PATH_site . 'typo3temp/Icons/' . $iconFileName;
                if (file_exists($path)) {
-                       // Returns if found in ../typo3temp/icons/
+                       // Returns if found in ../typo3temp/Icons/
                        return $mainpath;
                } else {
                        // Makes icon:
@@ -446,6 +446,10 @@ class IconUtility {
                                                self::imagecopyresized($im, $ol_im, 0, 0, 0, 0, imagesx($ol_im), imagesy($ol_im), imagesx($ol_im), imagesy($ol_im));
                                        }
                                        // Create the image as file, destroy GD image and return:
+                                       $targetDirectory = dirname($path);
+                                       if (!@is_dir($targetDirectory)) {
+                                               GeneralUtility::mkdir($targetDirectory);
+                                       }
                                        @self::imagemake($im, $path);
                                        GraphicalFunctions::gifCompress($path, 'IM');
                                        ImageDestroy($im);
index 77c63cf..0743215 100644 (file)
@@ -2659,7 +2659,10 @@ class GraphicalFunctions {
                        return $theFile;
                }
 
-               $newFile = PATH_site . 'typo3temp/readPG_' . md5(($theFile . '|' . filemtime($theFile))) . ($output_png ? '.png' : '.gif');
+               if (!@is_dir(PATH_site . 'typo3temp/GraphicalResources/')) {
+                       GeneralUtility::mkdir(PATH_site . 'typo3temp/GraphicalResources/');
+               }
+               $newFile = PATH_site . 'typo3temp/GraphicalResources/' . md5($theFile . '|' . filemtime($theFile)) . ($output_png ? '.png' : '.gif');
                $cmd = GeneralUtility::imageMagickCommand(
                        'convert', '"' . $theFile . '" "' . $newFile . '"', $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path']
                );
@@ -2668,6 +2671,7 @@ class GraphicalFunctions {
                        GeneralUtility::fixPermissions($newFile);
                        return $newFile;
                }
+               return NULL;
        }
 
        /***********************************
index 498a403..79b0569 100644 (file)
@@ -102,6 +102,7 @@ class TemplateService {
        public $ext_regComments = FALSE;
 
        /**
+        * @deprecated since TYPO3 CMS 7, will be removed with CMS 8.
         * @var string
         */
        public $tempPath = 'typo3temp/';
index a8933df..250a6b0 100755 (executable)
@@ -2637,58 +2637,56 @@ Connection: close
         * Writes $content to a filename in the typo3temp/ folder (and possibly one or two subfolders...)
         * Accepts an additional subdirectory in the file path!
         *
-        * @param string $filepath Absolute file path to write to inside "typo3temp/". First part of this string must match PATH_site."typo3temp/
+        * @param string $filepath Absolute file path to write to inside "typo3temp/". First part of this string must match PATH_site."typo3temp/"
         * @param string $content Content string to write
         * @return string Returns NULL on success, otherwise an error string telling about the problem.
         */
        static public function writeFileToTypo3tempDir($filepath, $content) {
+               if (!defined('PATH_site')) {
+                       return 'PATH_site constant was NOT defined!';
+               }
+
                // Parse filepath into directory and basename:
                $fI = pathinfo($filepath);
                $fI['dirname'] .= '/';
                // Check parts:
-               if (self::validPathStr($filepath) && $fI['basename'] && strlen($fI['basename']) < 60) {
-                       if (defined('PATH_site')) {
-                               // Setting main temporary directory name (standard)
-                               $dirName = PATH_site . 'typo3temp/';
-                               if (@is_dir($dirName)) {
-                                       if (self::isFirstPartOfStr($fI['dirname'], $dirName)) {
-                                               // Checking if the "subdir" is found:
-                                               $subdir = substr($fI['dirname'], strlen($dirName));
-                                               if ($subdir) {
-                                                       if (preg_match('/^[[:alnum:]_]+\\/$/', $subdir) || preg_match('/^[[:alnum:]_]+\\/[[:alnum:]_]+\\/$/', $subdir)) {
-                                                               $dirName .= $subdir;
-                                                               if (!@is_dir($dirName)) {
-                                                                       self::mkdir_deep(PATH_site . 'typo3temp/', $subdir);
-                                                               }
-                                                       } else {
-                                                               return 'Subdir, "' . $subdir . '", was NOT on the form "[[:alnum:]_]/" or  "[[:alnum:]_]/[[:alnum:]_]/"';
-                                                       }
-                                               }
-                                               // Checking dir-name again (sub-dir might have been created):
-                                               if (@is_dir($dirName)) {
-                                                       if ($filepath == $dirName . $fI['basename']) {
-                                                               self::writeFile($filepath, $content);
-                                                               if (!@is_file($filepath)) {
-                                                                       return 'The file was not written to the disk. Please, check that you have write permissions to the typo3temp/ directory.';
-                                                               }
-                                                       } else {
-                                                               return 'Calculated filelocation didn\'t match input $filepath!';
-                                                       }
-                                               } else {
-                                                       return '"' . $dirName . '" is not a directory!';
-                                               }
-                                       } else {
-                                               return '"' . $fI['dirname'] . '" was not within directory PATH_site + "typo3temp/"';
-                                       }
-                               } else {
-                                       return 'PATH_site + "typo3temp/" was not a directory!';
+               if (!self::validPathStr($filepath) || !$fI['basename'] || strlen($fI['basename']) >= 60) {
+                       return 'Input filepath "' . $filepath . '" was generally invalid!';
+               }
+               // Setting main temporary directory name (standard)
+               $dirName = PATH_site . 'typo3temp/';
+               if (!@is_dir($dirName)) {
+                       return 'PATH_site + "typo3temp/" was not a directory!';
+               }
+               if (!self::isFirstPartOfStr($fI['dirname'], $dirName)) {
+                       return '"' . $fI['dirname'] . '" was not within directory PATH_site + "typo3temp/"';
+               }
+               // Checking if the "subdir" is found:
+               $subdir = substr($fI['dirname'], strlen($dirName));
+               if ($subdir) {
+                       if (preg_match('/^[[:alnum:]_]+\\/$/', $subdir) || preg_match('/^[[:alnum:]_]+\\/[[:alnum:]_]+\\/$/', $subdir)) {
+                               $dirName .= $subdir;
+                               if (!@is_dir($dirName)) {
+                                       self::mkdir_deep(PATH_site . 'typo3temp/', $subdir);
+                               }
+                       } else {
+                               return 'Subdir, "' . $subdir . '", was NOT on the form "[[:alnum:]_]/" or  "[[:alnum:]_]/[[:alnum:]_]/"';
+                       }
+               }
+               // Checking dir-name again (sub-dir might have been created):
+               if (@is_dir($dirName)) {
+                       if ($filepath == $dirName . $fI['basename']) {
+                               self::writeFile($filepath, $content);
+                               if (!@is_file($filepath)) {
+                                       return 'The file was not written to the disk. Please, check that you have write permissions to the typo3temp/ directory.';
                                }
                        } else {
-                               return 'PATH_site constant was NOT defined!';
+                               return 'Calculated filelocation didn\'t match input "' . $filepath . '".';
                        }
                } else {
-                       return 'Input filepath "' . $filepath . '" was generally invalid!';
+                       return '"' . $dirName . '" is not a directory!';
                }
+               return NULL;
        }
 
        /**
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-69078-TemplateService-tempPath.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-69078-TemplateService-tempPath.rst
new file mode 100644 (file)
index 0000000..75fbc33
--- /dev/null
@@ -0,0 +1,21 @@
+================================================
+Deprecation: #69078 - TemplateService::$tempPath
+================================================
+
+Description
+===========
+
+The ``\TYPO3\CMS\Core\TypoScript\TemplateService::$tempPath`` member variable is not used anymore inside Core,
+therefore it has been deprecated and will be removed with CMS 8.
+
+
+Affected Installations
+======================
+
+Any installation using third party code, which accesses ``TemplateService::$tempPath``.
+
+
+Migration
+=========
+
+Remove any reference to ``TemplateService::$tempPath``.
index f1e3560..a7f27f3 100644 (file)
@@ -37,8 +37,8 @@ class DocumentationService {
                        }
 
                        // Cache file locally to be able to create a composer.json file when fetching a document
-                       $absoluteCacheFilename = GeneralUtility::getFileAbsFileName('typo3temp/documents.json');
-                       GeneralUtility::writeFile($absoluteCacheFilename, $json);
+                       $absoluteCacheFilename = GeneralUtility::getFileAbsFileName('typo3temp/Documentation/documents.json');
+                       GeneralUtility::writeFileToTypo3tempDir($absoluteCacheFilename, $json);
                }
                return $documents;
        }
@@ -161,7 +161,7 @@ class DocumentationService {
                $languageSegment = str_replace('_', '-', strtolower($language));
                $packageName = sprintf('%s-%s-%s.zip', $packagePrefix, $version, $languageSegment);
                $packageUrl = $url . 'packages/' . $packageName;
-               $absolutePathToZipFile = GeneralUtility::getFileAbsFileName('typo3temp/' . $packageName);
+               $absolutePathToZipFile = GeneralUtility::getFileAbsFileName('typo3temp/Documentation/' . $packageName);
 
                $packages = $this->getAvailablePackages($url);
                if (empty($packages) || !isset($packages[$version][$language])) {
@@ -181,7 +181,7 @@ class DocumentationService {
                        $http = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Http\HttpRequest::class, $packageUrl);
                        $response = $http->send();
                        if ($response->getStatus() == 200) {
-                               GeneralUtility::writeFile($absolutePathToZipFile, $response->getBody());
+                               GeneralUtility::writeFileToTypo3tempDir($absolutePathToZipFile, $response->getBody());
                        }
                }
 
@@ -191,7 +191,7 @@ class DocumentationService {
                        $result = $this->unzipDocumentPackage($absolutePathToZipFile, $absoluteDocumentPath);
 
                        // Create a composer.json file
-                       $absoluteCacheFilename = GeneralUtility::getFileAbsFileName('typo3temp/documents.json');
+                       $absoluteCacheFilename = GeneralUtility::getFileAbsFileName('typo3temp/Documentation/documents.json');
                        $documents = json_decode(file_get_contents($absoluteCacheFilename), TRUE);
                        foreach ($documents as $document) {
                                if ($document['key'] === $key) {
index fd416aa..96f03e7 100644 (file)
@@ -155,7 +155,7 @@ class ActionController extends AbstractController {
                $sqlData = $this->installUtility->getExtensionSqlDataDump($extension);
                $dump = $sqlData['extTables'] . $sqlData['staticSql'];
                $fileName = $extension . '_sqlDump.sql';
-               $filePath = PATH_site . 'typo3temp/' . $fileName;
+               $filePath = PATH_site . 'typo3temp/ExtensionManager/' . $fileName;
                $error = \TYPO3\CMS\Core\Utility\GeneralUtility::writeFileToTypo3tempDir($filePath, $dump);
                if (is_string($error)) {
                        throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException($error, 1343048718);
index e25cf1b..7ba6ab3 100644 (file)
@@ -401,7 +401,10 @@ class FileHandlingUtility implements \TYPO3\CMS\Core\SingletonInterface {
                        $version =  '0.0.0';
                }
 
-               $fileName = $this->getAbsolutePath('typo3temp/' . $extension . '_' . $version . '_' . date('YmdHi', $GLOBALS['EXEC_TIME']) . '.zip');
+               if (!@is_dir(PATH_site . 'typo3temp/ExtensionManager/')) {
+                       GeneralUtility::mkdir(PATH_site . 'typo3temp/ExtensionManager/');
+               }
+               $fileName = $this->getAbsolutePath('typo3temp/ExtensionManager/' . $extension . '_' . $version . '_' . date('YmdHi', $GLOBALS['EXEC_TIME']) . '.zip');
 
                $zip = new \ZipArchive();
                $zip->open($fileName, \ZipArchive::CREATE);
index 7a7cee5..7490070 100644 (file)
@@ -133,7 +133,7 @@ class Helper implements \TYPO3\CMS\Core\SingletonInterface {
         * writes them into a file in the local file system.
         *
         * @param string $remoteResource remote resource to read contents from
-        * @param string $localResource local resource (absolute file path) to store retrieved contents to
+        * @param string $localResource local resource (absolute file path) to store retrieved contents to (must be within typo3temp/)
         * @return void
         * @see \TYPO3\CMS\Core\Utility\GeneralUtility::getUrl(), \TYPO3\CMS\Core\Utility\GeneralUtility::writeFile()
         * @throws ExtensionManagerException
@@ -145,7 +145,7 @@ class Helper implements \TYPO3\CMS\Core\SingletonInterface {
                if (is_string($remoteResource) && is_string($localResource) && !empty($remoteResource) && !empty($localResource)) {
                        $fileContent = \TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($remoteResource, 0, array(TYPO3_user_agent));
                        if ($fileContent !== FALSE) {
-                               if (\TYPO3\CMS\Core\Utility\GeneralUtility::writeFile($localResource, $fileContent) === FALSE) {
+                               if (\TYPO3\CMS\Core\Utility\GeneralUtility::writeFileToTypo3tempDir($localResource, $fileContent) !== NULL) {
                                        throw new ExtensionManagerException(sprintf('Could not write to file %s.', $localResource), 1342635378);
                                }
                        } else {
@@ -162,7 +162,7 @@ class Helper implements \TYPO3\CMS\Core\SingletonInterface {
         * @see getRemoteExtListFile()
         */
        public function getLocalExtListFile() {
-               $absFilePath = PATH_site . 'typo3temp/' . (int)$this->repository->getUid() . '.extensions.xml.gz';
+               $absFilePath = PATH_site . 'typo3temp/ExtensionManager/' . (int)$this->repository->getUid() . '.extensions.xml.gz';
                return $absFilePath;
        }
 
@@ -200,7 +200,7 @@ class Helper implements \TYPO3\CMS\Core\SingletonInterface {
         * @see getRemoteMirrorListFile()
         */
        public function getLocalMirrorListFile() {
-               $absFilePath = PATH_site . 'typo3temp/' . (int)$this->repository->getUid() . '.mirrors.xml.gz';
+               $absFilePath = PATH_site . 'typo3temp/ExtensionManager/' . (int)$this->repository->getUid() . '.mirrors.xml.gz';
                return $absFilePath;
        }
 
index 46ef063..5cd6970 100644 (file)
@@ -553,7 +553,7 @@ class FileHandlingUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                // Create zip-file from extension
                $filename = $fileHandlerMock->_call('createZipFileFromExtension', $extKey);
 
-               $expectedFilename = PATH_site . 'typo3temp/' . $extKey . '_0.0.0_' . date('YmdHi', 42) . '.zip';
+               $expectedFilename = PATH_site . 'typo3temp/ExtensionManager/' . $extKey . '_0.0.0_' . date('YmdHi', 42) . '.zip';
                $this->testFilesToDelete[] = $filename;
                $this->assertEquals($expectedFilename, $filename, 'Archive file name differs from expectation');
 
index 037d8f4..21afad4 100644 (file)
@@ -1010,16 +1010,16 @@ class PageGenerator {
                $script = '';
                switch ($ext) {
                        case 'js':
-                               $script = 'typo3temp/javascript_' . substr(md5($str), 0, 10) . '.js';
+                               $script = 'typo3temp/Assets/' . substr(md5($str), 0, 10) . '.js';
                                break;
                        case 'css':
-                               $script = 'typo3temp/stylesheet_' . substr(md5($str), 0, 10) . '.css';
+                               $script = 'typo3temp/Assets/' . substr(md5($str), 0, 10) . '.css';
                                break;
                }
                // Write file:
                if ($script) {
-                       if (!@is_file((PATH_site . $script))) {
-                               GeneralUtility::writeFile(PATH_site . $script, $str);
+                       if (!@is_file(PATH_site . $script)) {
+                               GeneralUtility::writeFileToTypo3tempDir(PATH_site . $script, $str);
                        }
                }
                return $script;
index cab1e65..e639e51 100644 (file)
@@ -4,7 +4,7 @@
 <head>
 
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<!-- 
+<!--
        This website is powered by TYPO3 - inspiring people to share!
        TYPO3 is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.
        TYPO3 is copyright 1998-2012 of Kasper Skaarhoj. Extensions are copyright of their respective owners.
 <title>powermail</title>
 <meta name="generator" content="TYPO3 6.0 CMS">
 
-<link rel="stylesheet" type="text/css" href="typo3temp/stylesheet_427bb03fe1.css?1334416344" media="all">
+<link rel="stylesheet" type="text/css" href="typo3temp/Assets/427bb03fe1.css?1334416344" media="all">
 
 
 
-<script src="typo3temp/javascript_175aa1ef20.js?1340313498" type="text/javascript"></script>
+<script src="typo3temp/assets/175aa1ef20.js?1340313498" type="text/javascript"></script>
 
 
 <!--HD_679b52796e75d474ccbbed486b6837ab-->
@@ -35,4 +35,4 @@
 
 <!--FD_679b52796e75d474ccbbed486b6837ab-->
 </body>
-</html>
\ No newline at end of file
+</html>
index e175b0e..1134ab6 100644 (file)
@@ -124,7 +124,7 @@ class TerService extends \TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtili
                try {
                        $l10n = $this->fetchTranslation($extensionKey, $language, $mirrorUrl);
                        if (is_array($l10n)) {
-                               $absolutePathToZipFile = GeneralUtility::getFileAbsFileName('typo3temp/' . $extensionKey . '-l10n-' . $language . '.zip');
+                               $absolutePathToZipFile = GeneralUtility::getFileAbsFileName('typo3temp/Language/' . $extensionKey . '-l10n-' . $language . '.zip');
                                $relativeLanguagePath = 'l10n' . '/' . $language . '/';
                                $absoluteLanguagePath = GeneralUtility::getFileAbsFileName(PATH_typo3conf . $relativeLanguagePath);
                                $absoluteExtensionLanguagePath = GeneralUtility::getFileAbsFileName(PATH_typo3conf . $relativeLanguagePath . $extensionKey . '/');
@@ -134,7 +134,7 @@ class TerService extends \TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtili
                                if (!is_dir($absoluteLanguagePath)) {
                                        GeneralUtility::mkdir_deep(PATH_typo3conf, $relativeLanguagePath);
                                }
-                               GeneralUtility::writeFile($absolutePathToZipFile, $l10n[0]);
+                               GeneralUtility::writeFileToTypo3tempDir($absolutePathToZipFile, $l10n[0]);
                                if (is_dir($absoluteExtensionLanguagePath)) {
                                        GeneralUtility::rmdir($absoluteExtensionLanguagePath, TRUE);
                                }
index d387146..15f2a1f 100644 (file)
@@ -936,7 +936,7 @@ class RichTextElement extends AbstractFormElement {
         * @throws \RuntimeException If writing to file failed
         */
        protected function writeTemporaryFile($label, $fileExtension = 'js', $contents = '') {
-               $relativeFilename = 'typo3temp/rtehtmlarea_' . str_replace('-', '_', $label) . '_' . GeneralUtility::shortMD5($contents, 20) . '.' . $fileExtension;
+               $relativeFilename = 'typo3temp/RteHtmlArea/' . str_replace('-', '_', $label) . '_' . GeneralUtility::shortMD5($contents, 20) . '.' . $fileExtension;
                $destination = PATH_site . $relativeFilename;
                if (!file_exists($destination)) {
                        $minifiedJavaScript = '';
index 98df16b..abc5d02 100644 (file)
@@ -292,7 +292,7 @@ abstract class RteHtmlAreaApi {
         * @throws \RuntimeException If writing to file failed
         */
        protected function writeTemporaryFile($label, $fileExtension = 'js', $contents = '') {
-               $relativeFilename = 'typo3temp/rtehtmlarea_' . str_replace('-', '_', $label) . '_' . GeneralUtility::shortMD5($contents, 20) . '.' . $fileExtension;
+               $relativeFilename = 'typo3temp/RteHtmlArea/' . str_replace('-', '_', $label) . '_' . GeneralUtility::shortMD5($contents, 20) . '.' . $fileExtension;
                $destination = PATH_site . $relativeFilename;
                if (!file_exists($destination)) {
                        $minifiedJavaScript = '';