symfony/symfony — Issue #2577: [HttpFoundation] UploadedFile needs Locale parameter to pass
Author: helios-ag
Created: 2011-11-08 01:25:25+00:00
State: open

Because function basename() is locale aware, the constructor need to pass a locale parameter and set it in constructor. Without setting a locale non-latin first characters cut off from beginning until a latin letter or a non-letter character found in the name.

from HttpFoundation\File\UploadedFile.php

$this->originalName = basename($originalName);
$this->mimeType = $mimeType ?: 'application/octet-stream';
$this->size = $size;
$this->error = $error ?: UPLOAD_ERR_OK;
$this->test = (Boolean) $test;

parent::__construct($path, UPLOAD_ERR_OK === $this->error);
}