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 #1

Updated by Gerrit Code Review over 10 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/30631

Actions #2

Updated by Gerrit Code Review over 10 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/30631

Actions #3

Updated by Gerrit Code Review over 10 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/30631

Actions #4

Updated by Gerrit Code Review over 10 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/30631

Actions #5

Updated by Steffen Ritter over 10 years ago

  • Target version deleted (next-patchlevel)
Actions #6

Updated by Steffen Müller almost 10 years ago

  • Status changed from Under Review to Closed

Discussion in gerrit resulted in closing this issue without fix. This can get achieved using "directImageLink".

Docs have been updated to make this more clear: https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-Typoscript/pull/2/commits

Actions

Also available in: Atom PDF