Aggiornato Composer
This commit is contained in:
4
vendor/symfony/http-foundation/File/File.php
vendored
4
vendor/symfony/http-foundation/File/File.php
vendored
@@ -88,7 +88,7 @@ class File extends \SplFileInfo
|
||||
*
|
||||
* @throws FileException if the target file could not be created
|
||||
*/
|
||||
public function move(string $directory, string $name = null)
|
||||
public function move(string $directory, ?string $name = null)
|
||||
{
|
||||
$target = $this->getTargetFile($directory, $name);
|
||||
|
||||
@@ -121,7 +121,7 @@ class File extends \SplFileInfo
|
||||
/**
|
||||
* @return self
|
||||
*/
|
||||
protected function getTargetFile(string $directory, string $name = null)
|
||||
protected function getTargetFile(string $directory, ?string $name = null)
|
||||
{
|
||||
if (!is_dir($directory)) {
|
||||
if (false === @mkdir($directory, 0777, true) && !is_dir($directory)) {
|
||||
|
||||
@@ -60,7 +60,7 @@ class UploadedFile extends File
|
||||
* @throws FileException If file_uploads is disabled
|
||||
* @throws FileNotFoundException If the file does not exist
|
||||
*/
|
||||
public function __construct(string $path, string $originalName, string $mimeType = null, int $error = null, bool $test = false)
|
||||
public function __construct(string $path, string $originalName, ?string $mimeType = null, ?int $error = null, bool $test = false)
|
||||
{
|
||||
$this->originalName = $this->getName($originalName);
|
||||
$this->mimeType = $mimeType ?: 'application/octet-stream';
|
||||
@@ -74,7 +74,7 @@ class UploadedFile extends File
|
||||
* Returns the original file name.
|
||||
*
|
||||
* It is extracted from the request from which the file has been uploaded.
|
||||
* Then it should not be considered as a safe value.
|
||||
* This should not be considered as a safe value to use for a file name on your servers.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -87,7 +87,7 @@ class UploadedFile extends File
|
||||
* Returns the original file extension.
|
||||
*
|
||||
* It is extracted from the original file name that was uploaded.
|
||||
* Then it should not be considered as a safe value.
|
||||
* This should not be considered as a safe value to use for a file name on your servers.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -172,7 +172,7 @@ class UploadedFile extends File
|
||||
*
|
||||
* @throws FileException if, for any reason, the file could not have been moved
|
||||
*/
|
||||
public function move(string $directory, string $name = null)
|
||||
public function move(string $directory, ?string $name = null)
|
||||
{
|
||||
if ($this->isValid()) {
|
||||
if ($this->test) {
|
||||
@@ -223,8 +223,8 @@ class UploadedFile extends File
|
||||
*/
|
||||
public static function getMaxFilesize()
|
||||
{
|
||||
$sizePostMax = self::parseFilesize(ini_get('post_max_size'));
|
||||
$sizeUploadMax = self::parseFilesize(ini_get('upload_max_filesize'));
|
||||
$sizePostMax = self::parseFilesize(\ini_get('post_max_size'));
|
||||
$sizeUploadMax = self::parseFilesize(\ini_get('upload_max_filesize'));
|
||||
|
||||
return min($sizePostMax ?: \PHP_INT_MAX, $sizeUploadMax ?: \PHP_INT_MAX);
|
||||
}
|
||||
@@ -253,11 +253,11 @@ class UploadedFile extends File
|
||||
|
||||
switch (substr($size, -1)) {
|
||||
case 't': $max *= 1024;
|
||||
// no break
|
||||
// no break
|
||||
case 'g': $max *= 1024;
|
||||
// no break
|
||||
// no break
|
||||
case 'm': $max *= 1024;
|
||||
// no break
|
||||
// no break
|
||||
case 'k': $max *= 1024;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user