Project

General

Profile

Actions

Bug #59419

closed

Method "getImgResource" sets variable "origFile" to invalid value

Added by Bernhard Kraft over 10 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2014-06-09
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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.


Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Bug #62267: getImgResource some returns urlencoded file path, sometimes notRejected2014-10-16

Actions
Actions

Also available in: Atom PDF