Issue Bug Closed

#81024getFilenameFromMainDir() triggers PHP Warnings open_basedir

Christian Toffolo 04/26/17, 16:21 updated 10/17/17, 23:29

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.

Reviews 2