From: Benni Mack Date: Sat, 5 Dec 2015 12:58:19 +0000 (+0100) Subject: [BUGFIX] ColorPicker: Use absolute web path for exampleImg X-Git-Tag: 7.6.1~65 X-Git-Url: http://git.typo3.org/Packages/TYPO3.CMS.git/commitdiff_plain/828d107c9b1c8e216c20cb51a7be28107c36cf89 [BUGFIX] ColorPicker: Use absolute web path for exampleImg The Example Image of the color picker is currently hardcoded (also with ..) to the typo3/ directory. This hinders integrators to allow any other file outside of typo3/ to be shown. The patch corrects the path resolving part of the Color Picker. Resolves: #70428 Releases: master Change-Id: I2fb5a6b7379ee1cb5fd6e76d8081f2f72f91a098 Reviewed-on: https://review.typo3.org/45140 Reviewed-by: Wouter Wolters Reviewed-by: Andreas Fernandez Tested-by: Andreas Fernandez Reviewed-by: Morton Jonuschat Tested-by: Morton Jonuschat --- diff --git a/typo3/sysext/backend/Classes/Controller/Wizard/ColorpickerController.php b/typo3/sysext/backend/Classes/Controller/Wizard/ColorpickerController.php index 163d2e264818..f2df83aed7d3 100644 --- a/typo3/sysext/backend/Classes/Controller/Wizard/ColorpickerController.php +++ b/typo3/sysext/backend/Classes/Controller/Wizard/ColorpickerController.php @@ -20,6 +20,7 @@ use TYPO3\CMS\Backend\Template\DocumentTemplate; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Page\PageRenderer; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Core\Utility\PathUtility; /** * Script Class for colorpicker wizard @@ -148,9 +149,9 @@ class ColorpickerController extends AbstractWizardController // Resolving image (checking existence etc.) $this->imageError = ''; if ($this->exampleImg) { - $this->pickerImage = GeneralUtility::getFileAbsFileName($this->exampleImg, 1, 1); + $this->pickerImage = GeneralUtility::getFileAbsFileName($this->exampleImg); if (!$this->pickerImage || !@is_file($this->pickerImage)) { - $this->imageError = 'ERROR: The image, "' . $this->exampleImg . '", could not be found!'; + $this->imageError = 'ERROR: The image "' . $this->exampleImg . '" could not be found!'; } } $update = array(); @@ -375,7 +376,7 @@ class ColorpickerController extends AbstractWizardController } $pickerFormImage = '

' . $this->getLanguageService()->getLL('colorpicker_fromImage', true) . '

-
'; +
'; } else { $pickerFormImage = ''; }