[BUGFIX] Fix path check for custom RTE styles
authorStanislas Rolland <typo3@sjbr.ca>
Fri, 16 Dec 2011 17:08:27 +0000 (12:08 -0500)
committerStanislas Rolland <typo3@sjbr.ca>
Sat, 17 Dec 2011 15:43:36 +0000 (16:43 +0100)
Fix for #29899 introduced a check if the file holding
custom RTE CSS exists. However that path used was
wrong.

Change-Id: I1b4f23bb6bc29add925a956636fe3b8dd01f6b86
Resolves: #32625
Releases: 4.5, 4.6, 4.7
Reviewed-on: http://review.typo3.org/7314
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
Reviewed-by: Julian Hofmann
Tested-by: Julian Hofmann
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php

index 664573f..085d7ef 100644 (file)
@@ -450,10 +450,14 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                        // Get stylesheet file name from Page TSConfig if any
                $fileName = trim($this->thisConfig['contentCSS']);
                if ($fileName) {
-                       $filename = $this->getFullFileName($fileName);
+                       $fileName = $this->getFullFileName($fileName);
                }
+               $absolutePath = $fileName
+                       ? t3lib_div::resolveBackPath(PATH_site . (($this->is_FE() || $this->isFrontendEditActive()) ? '' : TYPO3_mainDir) . $fileName)
+                       : '';
+
                        // Fallback to default content css file if configured file does not exists or is of zero size
-               if (!$fileName || !file_exists(PATH_site . $fileName) || !filesize(PATH_site . $fileName)) {
+               if (!$fileName || !file_exists($absolutePath) || !filesize($absolutePath)) {
                        $fileName = $this->getFullFileName('EXT:' . $this->ID . '/res/contentcss/default.css');
                }
                return $fileName;