Project

General

Profile

Actions

Bug #59215

closed

t3lib_BEfunc::getThumbnail doesn't work anymore

Added by Jens no-lastname-given over 10 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2014-05-29
Due date:
% Done:

0%

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

Description

I migrated from 4.5 to 6.2.3. In 4.5 t3lib_BEfunc::getThumbnail($this->doc->backPath.'thumbs.php',PATH_site.$path.$file,'null',$imgsize) worked perfect.
In 6.2 an absolute path like PATH_site.$path.$file does not work in \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\View\\ThumbnailView') in init(). It is changed to PATH_site.PATH_site.$path.$file

A relative path like ../fileadmin/picture/test.jpg is accepted but the md5 check fails ($fileObject->calculateChecksum() == $md5sum). May be t3lib_BEfunc::getThumbnail is generating a wrong md5 checksum.
A relative path like fileadmin/picture/test.jpg is changed to /typo3/fileadmin/picture/test.jpg what is completly wrong


Files

ThumbnailView.php (15.3 KB) ThumbnailView.php Jens no-lastname-given, 2014-05-31 00:31

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #50301: Generated thumbnail's URL with BackendUtility::getThumbNail don't workClosed2013-07-22

Actions
Actions #1

Updated by Jens no-lastname-given over 10 years ago

We have 2 Problems:
t3lib_BEfunc::getThumbnail needs an absolute path and it uses function md5
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\View\\ThumbnailView')->init() in thumbs.php needs a relative path and uses function GeneralUtility::shortMD5

In the past t3lib_BEfunc::getThumbnail uses an absolute path. So for backwards compatibility I have changed only ThumbnailView.php

I have made a relative path from an absolute path in line 135
$relativeFilePath = substr($relativeFilePath,strlen(PATH_site));
I added PATH_site in line 169
$check = basename(PATH_site . $relativeFilePath) . ':' . $mTime . ':' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'];
I use md5 instead of GeneralUtility::shortMD5 in line 171
if (md5($check) === (string)$md5sum)

In the attachment you find my ThumbnailView.php which works as described.

Actions #2

Updated by Markus Klein over 10 years ago

Maybe you wanna push that to our review system?
Feel free to ask, if you need help.

Actions #4

Updated by Benni Mack over 9 years ago

  • Status changed from New to Needs Feedback

can you check if the current master / 6.2 works for you?

Actions #5

Updated by Riccardo De Contardi about 9 years ago

  • Status changed from Needs Feedback to Closed

No feedback within the last 90 days => closing this issue.

If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.

Actions

Also available in: Atom PDF