Project

General

Profile

Actions

Bug #77870

closed

Method moveTo in UploadedFile not implemented correctly according to PSR-7

Added by Mads Lønne Jensen over 7 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2016-09-07
Due date:
% Done:

100%

Estimated time:
1.00 h
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
no-brainer
Is Regression:
No
Sprint Focus:

Description

The method moveTo in TYPO3\CMS\Core\Http\UploadedFile should move the uploaded file to $target but is instead moved to $targetPath . basename($this->file), where $this->file is the temporary uploaded file.

The documentation for the moveTo method states that $targetPath is the "Path to which to move the uploaded file" and while it does not state that this path should be the path to the file and not just the folder, the accompanying example shows uses the path with a filename:

$file0->moveTo(DATA_DIR . '/' . $filename);

This is an issue in both 7.6.10 and 8.2.1

This issue is files as "bug" as it is an incorrect implementation of an interface.

Ref: http://www.php-fig.org/psr/psr-7/#1-6-uploaded-files

Actions

Also available in: Atom PDF