[BUGFIX] Fix start of identifier from /./ to / 79/20879/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:26:43 +0000 (19:26 +0200)
commit43cba3d28ebe65366af922dfbf24b0751312e30b
treefb572c7fddb643410d4bffd628557765707347cc
parent19b767ab553fe95a7da3088a4d76f3950df1e589
[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/20879
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php