Project

General

Profile

Actions

Bug #81024

closed

getFilenameFromMainDir() triggers PHP Warnings open_basedir

Added by Christian Toffolo almost 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Category:
Backend API
Target version:
Start date:
2016-11-28
Due date:
2016-11-28
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Method

\TYPO3\CMS\Core\Resource\ResourceCompressor::getFilenameFromMainDir()

triggers warnings
core: Core: Error handler (BE): PHP Warning: is_file(): open_basedir restriction in effect. File(/var/www/website/htdocs/../typo3conf/ext/extension/Resources/Public/file) is not within the allowed path(s):

when the BE is browsed.

This happens because "is_file($absolutePath)" checks outside the website root in the case of a passed file that has a relative path that begins with "../typo3conf/extension..." and open_basedir doesn't allow it.

Me and Markus Klein talked about the problem and decided to use the PHP error control operator @ to suppress the warnings because other solutions could break the code in other cases.


Related issues 3 (0 open3 closed)

Has duplicate TYPO3 Core - Bug #81115: TYPO3-Exception in BE-Log due to "PHP Warning: is_file(): open_basedir restriction in effect"Closed2016-11-282016-11-28

Actions
Is duplicate of TYPO3 Core - Bug #79218: ResourceCompressor.php PHP Warning: is_file(): open_basedir restriction in effectClosed2017-01-09

Actions
Follows TYPO3 Core - Bug #78803: ResourceCompressor can't deal with paths relative to docrootClosedMarkus Klein2016-11-25

Actions
Actions

Also available in: Atom PDF