[TASK] ResourceStorage->addFile() should not delete orig file if requested 83/47383/5
authorChristian Kuhn <lolli@schwarzbu.ch>
Thu, 24 Mar 2016 11:32:58 +0000 (12:32 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 30 Mar 2016 11:03:12 +0000 (13:03 +0200)
commit63d3a3d5821db25e7d75c1081a280a1df3e29937
tree7e1ae73eceb44763cf8102255d10363259dc5281
parentc39ea264d7191c418e62c40609dbb7846e59541f
[TASK] ResourceStorage->addFile() should not delete orig file if requested

FALs ResourceStorage->addFile() is the main method to populate a locale
file into a FAL storage. Internally, the method calls the assigned and
protected driver of this storage and calls addFile() on the
driver after checking permissions.
The method *always* deletes the local original file after it has been
added to the storage. This is funny, since addFile() should then call
moveFile(), but moveFile() exists and is only thought to move
files between storages and not from non-storage to storage.
The drivers addFile() however already contains an argument that
suppresses the deletion of the original file, but that argument is
not added to addFile() of the storage ...
The patch now adds this argument to the method signature of
ResourceStorage addFile() to mitigate the issue in a fully
backwards compatible way.
Since the patch is non-destructive and low-risk, the
patch is requested for 7.6, too.

Change-Id: I201c7eac10f7d35db5bdff889b3561ad5b1dce8b
Resolves: #70012
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/47383
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Classes/Resource/ResourceStorage.php