[BUGFIX] RTE-API: correct check for backpath in writeTemporaryFile 69/44769/2
authorAndreas Allacher <andreas@allacher.com>
Wed, 18 Nov 2015 15:06:29 +0000 (16:06 +0100)
committerAndreas Fernandez <typo3@scripting-base.de>
Wed, 18 Nov 2015 15:56:42 +0000 (16:56 +0100)
\TYPO3\CMS\Rtehtmlarea\RteHtmlAreaApi::writeTemporaryFile needs to
also check regarding FE_MODE or frontend editing active like in
\TYPO3\CMS\Rtehtmlarea\RteHtmlAreaApi::getFullFileName to
resolve the backpath.

Otherwise extensions that create a TSFE object in the backend
but don't remove it, might result in wrong paths being used.

Change-Id: I7e16c4d7037d90c5dc044e5882455916e6c43a4b
Resolves: #71656
Releases: master
Reviewed-on: https://review.typo3.org/44769
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/rtehtmlarea/Classes/RteHtmlAreaApi.php

index 76baf3b..0676d3d 100644 (file)
@@ -320,7 +320,7 @@ abstract class RteHtmlAreaApi
                 throw new \RuntimeException($failure, 1294585668);
             }
         }
-        if (isset($GLOBALS['TSFE'])) {
+        if ($this->isFrontend() || $this->isFrontendEditActive()) {
             $fileName = $relativeFilename;
         } else {
             $fileName = '../' . $relativeFilename;