Project

General

Profile

Actions

Bug #19432

closed

getHtmlTemplate should use resolveBackPath

Added by Steffen Gebert over 15 years ago. Updated over 15 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2008-10-08
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.2
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

getHtmlTemplate() in typo3/template.php:
t3lib_div::getURL($this->backPath . $filename)

For tt_news $this->backPath . $filename = "../../../../typo3/../typo3conf/ext/tt_news/mod1/mod_ttneypo3conf/ext/tt_news/mod1/mod_ttnews_admin.html" which can't be opened on some linux servers.

resolveBackPath removes "typo3/../" which works.

The attached patch changes getHtmlTemplate() to use resolveBackPath().

PHP-function realpath() usually should do this job (following manual) but seems to have some problems (different implementations in different PHP versions / platforms; suhosin replaces default implementation). My Server with 5.2.3 and suhosin returned wrong path: /var/www/vhosts/dmm.travel/subdomains/dev/httpdocs/typo3_src_svn_trunk/typo3conf/ext/tt_news/mod1/mod_ttnews_admin.html

t3lib_div::getFileAbsFileName() also doesn't work (returns nothing), seems to have problems with paths starting with ../ which is IMHO bad behaviour.

For debugging you might place the following code in typo3/template.php:getHtmlPath():
echo t3lib_div::print_array(
array(
'raw' => $this->backPath . $filename,
'realpath' => realpath($this->backPath . $filename),
'resolveBackPath' => t3lib_div::resolveBackPath($this->backPath . $filename),
'getFileAbsFilename(resolveBackPath)' => t3lib_div::getFileAbsFileName(t3lib_div::resolveBackPath($this->backPath . $filename)),
)
);
(issue imported from #M9511)


Files

getHtmlTemplate-resolveBackPath.patch (611 Bytes) getHtmlTemplate-resolveBackPath.patch Administrator Admin, 2008-10-08 09:33

Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Bug #19416: getHtmlTemplate should use resolveBackPathClosedChristian Kuhn2008-10-05

Actions
Actions

Also available in: Atom PDF