[BUGFIX] Compressor resolves dots in filenames correctly 10/25010/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Thu, 17 Oct 2013 16:46:47 +0000 (18:46 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 12 Nov 2013 22:41:31 +0000 (23:41 +0100)
commit9aa1fa232669e6f2eedfeadb22ef7b28afb25783
tree69f0087d6aef5de73e071803a97eb972b2296c79
parentfa77640d5d886cbfac0623b19cbbff38dfe1bdf9
[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/25010
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/core/Classes/Resource/ResourceCompressor.php