[BUGFIX] Fix start of identifier from /./ to / 48/20348/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:23:27 +0000 (19:23 +0200)
commitf969ef1ebb9cbce370756ace0db06e5e81e343f6
treeb9f3644a63d7f6e3e578caae2630be5ec56f1f05
parent632e0a159ecdac34ee725bfe9304bfd337ac4dd4
[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/20348
Reviewed-by: Peter Niederlag
Tested-by: Peter Niederlag
Reviewed-by: Dmitry Dulepov
Tested-by: Dmitry Dulepov
Reviewed-by: Stefan Neufeind
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php