[BUGFIX] Fix start of identifier from /./ to / 80/20880/2
authorAlexander Opitz <opitz.alexander@googlemail.com>
Tue, 30 Apr 2013 08:26:21 +0000 (10:26 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Fri, 17 May 2013 17:28:30 +0000 (19:28 +0200)
commit5e2f5bb89766bdc361fde11520ae05c53fcd2bfb
tree21da91d72fc354c58123ed44839be5f0d352ffd6
parentf94f4eb1dc800a320902a31d897aa69904d7c6b9
[BUGFIX] Fix start of identifier from /./ to /

The PHP function dirname returns an dot if the given filename
do not have a path included. On this path we pre- and append a
slash as directory seperator and this leads to /./ for the identifier.

By handling the dot and replace it with a single slash we get the
clean identifier we need. The result of dirname shouldn't be
empty, but we also will replace this with a single slash.

The problem didn't occured yet, as we didn't saved the resulting
file object in the index, which was changed by #46595

Reproducing:
* select the default LocalStorage root directory (fileadmin/)
* Upload a file
* Look in the sys_file table you have 2 entries without this patch.

Resolves: #47705
Releases: 6.2, 6.1, 6.0
Change-Id: I1c927fe768e3b622fde8d9f6665f78bf277b46f7
Reviewed-on: https://review.typo3.org/20880
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php