Bug #59419
closedMethod "getImgResource" sets variable "origFile" to invalid value
0%
Description
When the method "getImgResource" (ContentObjectRendere.php) gets called it sets the variable "origFile" according to the following statement:
'origFile' => $fileObject->getPublicUrl(),
In the "ImageResourceContentObject" (IMG_RESOURCE) the return value of "getImgResource" is used as folowing:
$GLOBALS['TSFE']->lastImgResourceInfo = $this->cObj->getImgResource($conf['file'], $conf['file.']);
As the method "getPublicUrl" is used for retrieving the "origFile" variable this value will be URL encoded. Now if there is a special character like space or umlauts in the filename the value "origFile" will not contain the original filename but rather a value which can get used to link to the file in URLs. This is different than in previous versions of TYPO3:
$GLOBALS['TSFE']->tmpl->fileCache[$hash]['origFile'] = $theImage;
I suggest to change the call to "getPublicUrl()" to "getForLocalProcessing()". I assume the name "origFile" rather tends to get filled with an filename than an URL.
Some extensions like "chgallery" refuse to have a properly working lightbox if this doesn't get changed. The problem there is that "TSFE:lastImgResourceInfo|origFile" gets passed again to IMG_RESOURCE and IMG_RESOURCE will refuse to work on a filename with "%20" or other url-encoded filenames.
I guess this issue will affect every IMAGE and IMG_RESOURCE TypoScript object where inside the object the originial file is used for generating alternate variants of the image. The only sense for having an URL encoded value in "origFile" would be to generate download links - but I guess doing a rawurlencode() of the filename should be done by the presentation layer.
I will create a patch and send it to gerrit for review.