[BUGFIX] Compressor resolves dots in filenames correctly 75/24875/5
authorChristian Kuhn <lolli@schwarzbu.ch>
Thu, 17 Oct 2013 16:46:47 +0000 (18:46 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Fri, 25 Oct 2013 17:38:04 +0000 (19:38 +0200)
commited5e07525ea7a8ac6afa72a1ce142bc306e74a7e
tree8d0f9ceb6d15e562649c6b505eecc67c3854b637
parent1d080a7dc7e2467d55f089ed5cc0252ef83650ff
[BUGFIX] Compressor resolves dots in filenames correctly

Method getFilenameFromMainDir() tries to resolve a given file path
to a path relative to the document root and takes care of file
existance.

Sometimes it is fed with a path like '../path/to/file' and then
prepends it with the document root to call an is_file() on it. The
constructed path is then '/path/to/doc/root/typo3/../path/to/file'. If
now 'root' is a symlink to some sub structure itself, is_file()
will fail, because it does not solve the '..' part correctly anymore.

Using resolveBackPath() on the path before feeding it to is_file()
transforms the path to '/path/to/doc/root/path/to/file'. So the dots
are resolved and is_file is happy.

Change-Id: I20b4f4bbea695aeb02e3d92469236bc63cd05d97
Resolves: #52926
Releases: 6.2, 6.1, 6.0, 4.7
Reviewed-on: https://review.typo3.org/24875
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/core/Classes/Resource/ResourceCompressor.php