[BUGFIX] Replace split_fileref() by pathinfo() in ResourceStorage 21/38221/3
authorFrans Saris <franssaris@gmail.com>
Wed, 25 Mar 2015 19:43:05 +0000 (20:43 +0100)
committerFrans Saris <franssaris@gmail.com>
Thu, 26 Mar 2015 20:54:52 +0000 (21:54 +0100)
commit05b26eb7699a7e8e2c2dc6968ebb287d3cfa347d
tree3e5dafcd5b5a78596b5b5c0c6a1edd8912a72585
parent347ff47247caba6117425e74657579404487e365
[BUGFIX] Replace split_fileref() by pathinfo() in ResourceStorage

GeneralUtility::split_fileref($fileName) expects the given $fileName to
be an existing file as it checks if the given file is a directory or
not using is_dir(). The ResourceStorage only provides the name of the
file without path when calling it.

Checking is_dir() on a file without correct path on systems with
open_basedir restrictions triggers the PHP Warning: 'is_dir():
open_basedir restriction in effect'.

Replace the calls to split_fileref() with PathUtility::pathinfo() as
this function doesn't check/care whether the path is real.

Document the behavior of split_fileref().

Resolves: #66033
Releases: master, 6.2
Change-Id: I5b4c953461ed3e9e374614a5ca6037842cc18546
Reviewed-on: http://review.typo3.org/38221
Reviewed-by: Stephan Großberndt <stephan@grossberndt.de>
Tested-by: Stephan Großberndt <stephan@grossberndt.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
typo3/sysext/core/Classes/Resource/ResourceStorage.php
typo3/sysext/core/Classes/Utility/GeneralUtility.php