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

Change-Id: I9923b34f18ffd357439081f34bf69339820fa714
Fixes: #32625
Releases: 4.5, 4.6, 4.7
Reviewed-on: http://review.typo3.org/7341
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland
typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php

index a80dba1..434c824 100644 (file)
@@ -451,9 +451,13 @@ 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);
                }
-               if (!$fileName || !file_exists(PATH_site . $fileName) || !filesize(PATH_site . $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($absolutePath) || !filesize($absolutePath)) {
                        $fileName = $this->getFullFileName('EXT:' . $this->ID . '/res/contentcss/default.css');
                }
                return $fileName;