8000 [HttpFoundation] fixed PHP 5.4 regression · Kiruban2011/symfony@3043fa0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3043fa0

Browse files
committed
[HttpFoundation] fixed PHP 5.4 regression
1 parent 8dcde3c commit 3043fa0

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/Symfony/Component/HttpFoundation/File/File.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,15 +445,16 @@ class File extends \SplFileInfo
445445
/**
446446
* Constructs a new file from the given path.
447447
*
448-
* @param string $path The path to the file
448+
* @param string $path The path to the file
449+
* @param Boolean $checkPath Whether to check the path or not
449450
*
450451
* @throws FileNotFoundException If the given path is not a file
451452
*
452453
* @api
453454
*/
454-
public function __construct($path)
455+
public function __construct($path, $checkPath = true)
455456
{
456-
if (!is_file($path)) {
457+
if ($checkPath && !is_file($path)) {
457458
throw new FileNotFoundException($path);
458459
}
459460

src/Symfony/Component/HttpFoundation/File/UploadedFile.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,7 @@ public function __construct($path, $originalName, $mimeType = null, $size = null
100100
$this->error = $error ?: UPLOAD_ERR_OK;
101101
$this->test = (Boolean) $test;
102102

103-
if (UPLOAD_ERR_OK === $this->error) {
104-
parent::__construct($path);
105-
}
103+
parent::__construct($path, UPLOAD_ERR_OK === $this->error);
106104
}
107105

108106
/**

0 commit comments

Comments
 (0)
0