From fe8808cf7b81abb7fb5359b4024f9e733644ae9f Mon Sep 17 00:00:00 2001 From: Timothy Batt Date: Mon, 5 Jun 2023 14:18:22 -0400 Subject: [PATCH 01/13] added `UploadedFile::getClientPath()` Adds access to the file's `full_path` index --- system/HTTP/Files/FileCollection.php | 1 + system/HTTP/Files/UploadedFile.php | 20 ++++++++++++++++++- system/HTTP/Files/UploadedFileInterface.php | 9 ++++++++- .../system/HTTP/Files/FileCollectionTest.php | 12 ++++++----- 4 files changed, 35 insertions(+), 7 deletions(-) diff --git a/system/HTTP/Files/FileCollection.php b/system/HTTP/Files/FileCollection.php index 87f31ee511ea..66bb46b74b4e 100644 --- a/system/HTTP/Files/FileCollection.php +++ b/system/HTTP/Files/FileCollection.php @@ -180,6 +180,7 @@ protected function createFileObject(array $array) return new UploadedFile( $array['tmp_name'] ?? null, $array['name'] ?? null, + $array['full_path'] ?? null, $array['type'] ?? null, $array['size'] ?? null, $array['error'] ?? null diff --git a/system/HTTP/Files/UploadedFile.php b/system/HTTP/Files/UploadedFile.php index a9e81cd97ee1..757fca872a46 100644 --- a/system/HTTP/Files/UploadedFile.php +++ b/system/HTTP/Files/UploadedFile.php @@ -34,6 +34,13 @@ class UploadedFile extends File implements UploadedFileInterface */ protected $path; + /** + * The webkit relative path of the file. + * + * @var string + */ + protected $clientPath; + /** * The original filename as provided by the client. * @@ -75,13 +82,15 @@ class UploadedFile extends File implements UploadedFileInterface * * @param string $path The temporary location of the uploaded file. * @param string $originalName The client-provided filename. + * @param string $clientPath The webkit relative path of the uploaded file. * @param string $mimeType The type of file as provided by PHP * @param int $size The size of the file, in bytes * @param int $error The error constant of the upload (one of PHP's UPLOADERRXXX constants) */ - public function __construct(string $path, string $originalName, ?string $mimeType = null, ?int $size = null, ?int $error = null) + public function __construct(string $path, string $originalName, ?string $clientPath, ?string $mimeType = null, ?int $size = null, ?int $error = null) { $this->path = $path; + $this->clientPath = $clientPath; $this->name = $originalName; $this->originalName = $originalName; $this->originalMimeType = $mimeType; @@ -267,6 +276,15 @@ public function getClientName(): string return $this->originalName; } + /** + * (PHP 8.1+) + * Returns the webkit relative path of the uploaded file on directory uploads. + */ + public function getClientPath(): string + { + return $this->clientPath; + } + /** * Gets the temporary filename where the file was uploaded to. */ diff --git a/system/HTTP/Files/UploadedFileInterface.php b/system/HTTP/Files/UploadedFileInterface.php index 37c18554a106..f8b2f0dd0021 100644 --- a/system/HTTP/Files/UploadedFileInterface.php +++ b/system/HTTP/Files/UploadedFileInterface.php @@ -28,11 +28,12 @@ interface UploadedFileInterface * * @param string $path The temporary location of the uploaded file. * @param string $originalName The client-provided filename. + * @param string $clientPath The webkit relative path of the uploaded file. * @param string $mimeType The type of file as provided by PHP * @param int $size The size of the file, in bytes * @param int $error The error constant of the upload (one of PHP's UPLOADERRXXX constants) */ - public function __construct(string $path, string $originalName, ?string $mimeType = null, ?int $size = null, ?int $error = null); + public function __construct(string $path, string $originalName, ?string $clientPath, ?string $mimeType = null, ?int $size = null, ?int $error = null); /** * Move the uploaded file to a new location. @@ -109,6 +110,12 @@ public function getName(): string; */ public function getTempName(): string; + /** + * (PHP 8.1+) + * Returns the webkit relative path of the uploaded file on directory uploads. + */ + public function getClientPath(): string; + /** * Returns the original file extension, based on the file name that * was uploaded. This is NOT a trusted source. diff --git a/tests/system/HTTP/Files/FileCollectionTest.php b/tests/system/HTTP/Files/FileCollectionTest.php index c9d2c0123acf..a226297f59bd 100644 --- a/tests/system/HTTP/Files/FileCollectionTest.php +++ b/tests/system/HTTP/Files/FileCollectionTest.php @@ -38,11 +38,12 @@ public function testAllReturnsValidSingleFile() { $_FILES = [ 'userfile' => [ - 'name' => 'someFile.txt', - 'type' => 'text/plain', - 'size' => '124', - 'tmp_name' => '/tmp/myTempFile.txt', - 'error' => 0, + 'name' => 'someFile.txt', + 'type' => 'text/plain', + 'size' => '124', + 'tmp_name' => '/tmp/myTempFile.txt', + 'full_path' => 'tmp/myTempFile.txt', + 'error' => 0, ], ]; @@ -54,6 +55,7 @@ public function testAllReturnsValidSingleFile() $this->assertInstanceOf(UploadedFile::class, $file); $this->assertSame('someFile.txt', $file->getName()); + $this->assertSame('tmp/myTempFile.txt', $file->getClientPath()); $this->assertSame(124, $file->getSize()); } From 3e2b4c777f52e2ec3b00502275a1ad696e0b94d6 Mon Sep 17 00:00:00 2001 From: Timothy Batt Date: Mon, 5 Jun 2023 14:33:54 -0400 Subject: [PATCH 02/13] corrected `UploadedFile::getClientPath()` return types --- system/HTTP/Files/UploadedFile.php | 2 +- system/HTTP/Files/UploadedFileInterface.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/system/HTTP/Files/UploadedFile.php b/system/HTTP/Files/UploadedFile.php index 757fca872a46..7afecf4c3542 100644 --- a/system/HTTP/Files/UploadedFile.php +++ b/system/HTTP/Files/UploadedFile.php @@ -280,7 +280,7 @@ public function getClientName(): string * (PHP 8.1+) * Returns the webkit relative path of the uploaded file on directory uploads. */ - public function getClientPath(): string + public function getClientPath(): string|null { return $this->clientPath; } diff --git a/system/HTTP/Files/UploadedFileInterface.php b/system/HTTP/Files/UploadedFileInterface.php index f8b2f0dd0021..8f2d8624f07c 100644 --- a/system/HTTP/Files/UploadedFileInterface.php +++ b/system/HTTP/Files/UploadedFileInterface.php @@ -114,7 +114,7 @@ public function getTempName(): string; * (PHP 8.1+) * Returns the webkit relative path of the uploaded file on directory uploads. */ - public function getClientPath(): string; + public function getClientPath(): string|null; /** * Returns the original file extension, based on the file name that From 8d6d9ad7648ece2dbc9d2f9e2880877589cde46a Mon Sep 17 00:00:00 2001 From: Timothy Batt Date: Mon, 5 Jun 2023 15:39:25 -0400 Subject: [PATCH 03/13] added docs for `UploadedFile::getClientPath()` --- user_guide_src/source/libraries/uploaded_files.rst | 8 ++++++++ user_guide_src/source/libraries/uploaded_files/023.php | 4 ++++ 2 files changed, 12 insertions(+) create mode 100644 user_guide_src/source/libraries/uploaded_files/023.php diff --git a/user_guide_src/source/libraries/uploaded_files.rst b/user_guide_src/source/libraries/uploaded_files.rst index b91b34ecd718..13b9f9f12aca 100644 --- a/user_guide_src/source/libraries/uploaded_files.rst +++ b/user_guide_src/source/libraries/uploaded_files.rst @@ -304,6 +304,14 @@ version, use ``getMimeType()`` instead: .. literalinclude:: uploaded_files/015.php +getClientPath() +--------------- + +Returns the `webkit relative path `_ of the uploaded file when the client has uploaded files via directory upload. +In PHP versions below 8.1, this returns ``null`` + +.. literalinclude:: uploaded_files/023.php + Moving Files ============ diff --git a/user_guide_src/source/libraries/uploaded_files/023.php b/user_guide_src/source/libraries/uploaded_files/023.php new file mode 100644 index 000000000000..f8accc9087b1 --- /dev/null +++ b/user_guide_src/source/libraries/uploaded_files/023.php @@ -0,0 +1,4 @@ +getClientPath(); +echo $clientPath; // dir/file.txt, or dir/sub_dir/file.txt From 252ef6cdb5c34be6b2f517db782489496d702fc2 Mon Sep 17 00:00:00 2001 From: Timothy Batt Date: Mon, 5 Jun 2023 21:39:51 -0400 Subject: [PATCH 04/13] set `$clientPath` default to `null` --- system/HTTP/Files/UploadedFile.php | 2 +- system/HTTP/Files/UploadedFileInterface.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/system/HTTP/Files/UploadedFile.php b/system/HTTP/Files/UploadedFile.php index 7afecf4c3542..d19c905cd8e9 100644 --- a/system/HTTP/Files/UploadedFile.php +++ b/system/HTTP/Files/UploadedFile.php @@ -87,7 +87,7 @@ class UploadedFile extends File implements UploadedFileInterface * @param int $size The size of the file, in bytes * @param int $error The error constant of the upload (one of PHP's UPLOADERRXXX constants) */ - public function __construct(string $path, string $originalName, ?string $clientPath, ?string $mimeType = null, ?int $size = null, ?int $error = null) + public function __construct(string $path, string $originalName, ?string $clientPath = null, ?string $mimeType = null, ?int $size = null, ?int $error = null) { $this->path = $path; $this->clientPath = $clientPath; diff --git a/system/HTTP/Files/UploadedFileInterface.php b/system/HTTP/Files/UploadedFileInterface.php index 8f2d8624f07c..2b282069d562 100644 --- a/system/HTTP/Files/UploadedFileInterface.php +++ b/system/HTTP/Files/UploadedFileInterface.php @@ -33,7 +33,7 @@ interface UploadedFileInterface * @param int $size The size of the file, in bytes * @param int $error The error constant of the upload (one of PHP's UPLOADERRXXX constants) */ - public function __construct(string $path, string $originalName, ?string $clientPath, ?string $mimeType = null, ?int $size = null, ?int $error = null); + public function __construct(string $path, string $originalName, ?string $clientPath = null, ?string $mimeType = null, ?int $size = null, ?int $error = null); /** * Move the uploaded file to a new location. From e57bd28818690e3d6297ba393891c381ef34aaba Mon Sep 17 00:00:00 2001 From: Timothy Batt Date: Mon, 5 Jun 2023 21:43:29 -0400 Subject: [PATCH 05/13] update `$clientPath` param to last param position --- system/HTTP/Files/FileCollection.php | 4 ++-- system/HTTP/Files/UploadedFile.php | 2 +- system/HTTP/Files/UploadedFileInterface.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/system/HTTP/Files/FileCollection.php b/system/HTTP/Files/FileCollection.php index 66bb46b74b4e..7b117f4f8e02 100644 --- a/system/HTTP/Files/FileCollection.php +++ b/system/HTTP/Files/FileCollection.php @@ -180,10 +180,10 @@ protected function createFileObject(array $array) return new UploadedFile( $array['tmp_name'] ?? null, $array['name'] ?? null, - $array['full_path'] ?? null, $array['type'] ?? null, $array['size'] ?? null, - $array['error'] ?? null + $array['error'] ?? null, + $array['full_path'] ?? null ); } diff --git a/system/HTTP/Files/UploadedFile.php b/system/HTTP/Files/UploadedFile.php index d19c905cd8e9..f5b4667a9cf5 100644 --- a/system/HTTP/Files/UploadedFile.php +++ b/system/HTTP/Files/UploadedFile.php @@ -87,7 +87,7 @@ class UploadedFile extends File implements UploadedFileInterface * @param int $size The size of the file, in bytes * @param int $error The error constant of the upload (one of PHP's UPLOADERRXXX constants) */ - public function __construct(string $path, string $originalName, ?string $clientPath = null, ?string $mimeType = null, ?int $size = null, ?int $error = null) + public function __construct(string $path, string $originalName, ?string $mimeType = null, ?int $size = null, ?int $error = null, ?string $clientPath = null) { $this->path = $path; $this->clientPath = $clientPath; diff --git a/system/HTTP/Files/UploadedFileInterface.php b/system/HTTP/Files/UploadedFileInterface.php index 2b282069d562..825fc1f4c61f 100644 --- a/system/HTTP/Files/UploadedFileInterface.php +++ b/system/HTTP/Files/UploadedFileInterface.php @@ -33,7 +33,7 @@ interface UploadedFileInterface * @param int $size The size of the file, in bytes * @param int $error The error constant of the upload (one of PHP's UPLOADERRXXX constants) */ - public function __construct(string $path, string $originalName, ?string $clientPath = null, ?string $mimeType = null, ?int $size = null, ?int $error = null); + public function __construct(string $path, string $originalName, ?string $mimeType = null, ?int $size = null, ?int $error = null, ?string $clientPath = null); /** * Move the uploaded file to a new location. From 1e5db7600389a65997297fecc9682a64588a0654 Mon Sep 17 00:00:00 2001 From: Timothy Batt Date: Mon, 5 Jun 2023 21:55:59 -0400 Subject: [PATCH 06/13] made test full path more realistic --- tests/system/HTTP/Files/FileCollectionTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/system/HTTP/Files/FileCollectionTest.php b/tests/system/HTTP/Files/FileCollectionTest.php index a226297f59bd..d79032e26b5e 100644 --- a/tests/system/HTTP/Files/FileCollectionTest.php +++ b/tests/system/HTTP/Files/FileCollectionTest.php @@ -42,7 +42,7 @@ public function testAllReturnsValidSingleFile() 'type' => 'text/plain', 'size' => '124', 'tmp_name' => '/tmp/myTempFile.txt', - 'full_path' => 'tmp/myTempFile.txt', + 'full_path' => 'someDir/someFile.txt', 'error' => 0, ], ]; @@ -55,7 +55,7 @@ public function testAllReturnsValidSingleFile() $this->assertInstanceOf(UploadedFile::class, $file); $this->assertSame('someFile.txt', $file->getName()); - $this->assertSame('tmp/myTempFile.txt', $file->getClientPath()); + $this->assertSame('someDir/someFile.txt', $file->getClientPath()); $this->assertSame(124, $file->getSize()); } From 9be23aa5f04c79d484b7835a489238b64c110325 Mon Sep 17 00:00:00 2001 From: Timothy Batt Date: Mon, 5 Jun 2023 21:57:38 -0400 Subject: [PATCH 07/13] made return type for `UploadedFile::getClientPath()` nullable --- system/HTTP/Files/UploadedFile.php | 2 +- system/HTTP/Files/UploadedFileInterface.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/system/HTTP/Files/UploadedFile.php b/system/HTTP/Files/UploadedFile.php index f5b4667a9cf5..acd5ca48397f 100644 --- a/system/HTTP/Files/UploadedFile.php +++ b/system/HTTP/Files/UploadedFile.php @@ -280,7 +280,7 @@ public function getClientName(): string * (PHP 8.1+) * Returns the webkit relative path of the uploaded file on directory uploads. */ - public function getClientPath(): string|null + public function getClientPath(): ?string { return $this->clientPath; } diff --git a/system/HTTP/Files/UploadedFileInterface.php b/system/HTTP/Files/UploadedFileInterface.php index 825fc1f4c61f..9add0f2f6229 100644 --- a/system/HTTP/Files/UploadedFileInterface.php +++ b/system/HTTP/Files/UploadedFileInterface.php @@ -114,7 +114,7 @@ public function getTempName(): string; * (PHP 8.1+) * Returns the webkit relative path of the uploaded file on directory uploads. */ - public function getClientPath(): string|null; + public function getClientPath(): ?string; /** * Returns the original file extension, based on the file name that From a387052a35b7312ddc092a0945673ce6d1ad7d2c Mon Sep 17 00:00:00 2001 From: Timothy Batt Date: Mon, 5 Jun 2023 22:00:11 -0400 Subject: [PATCH 08/13] updated order of `$clientPath` param in doc string --- system/HTTP/Files/UploadedFile.php | 2 +- system/HTTP/Files/UploadedFileInterface.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/system/HTTP/Files/UploadedFile.php b/system/HTTP/Files/UploadedFile.php index acd5ca48397f..44c45571187a 100644 --- a/system/HTTP/Files/UploadedFile.php +++ b/system/HTTP/Files/UploadedFile.php @@ -82,10 +82,10 @@ class UploadedFile extends File implements UploadedFileInterface * * @param string $path The temporary location of the uploaded file. * @param string $originalName The client-provided filename. - * @param string $clientPath The webkit relative path of the uploaded file. * @param string $mimeType The type of file as provided by PHP * @param int $size The size of the file, in bytes * @param int $error The error constant of the upload (one of PHP's UPLOADERRXXX constants) + * @param string $clientPath The webkit relative path of the uploaded file. */ public function __construct(string $path, string $originalName, ?string $mimeType = null, ?int $size = null, ?int $error = null, ?string $clientPath = null) { diff --git a/system/HTTP/Files/UploadedFileInterface.php b/system/HTTP/Files/UploadedFileInterface.php index 9add0f2f6229..075c4190a381 100644 --- a/system/HTTP/Files/UploadedFileInterface.php +++ b/system/HTTP/Files/UploadedFileInterface.php @@ -28,10 +28,10 @@ interface UploadedFileInterface * * @param string $path The temporary location of the uploaded file. * @param string $originalName The client-provided filename. - * @param string $clientPath The webkit relative path of the uploaded file. * @param string $mimeType The type of file as provided by PHP * @param int $size The size of the file, in bytes * @param int $error The error constant of the upload (one of PHP's UPLOADERRXXX constants) + * @param string $clientPath The webkit relative path of the uploaded file. */ public function __construct(string $path, string $originalName, ?string $mimeType = null, ?int $size = null, ?int $error = null, ?string $clientPath = null); From b7d4c2b60ccdea4f33aee764e7393f16ac00a435 Mon Sep 17 00:00:00 2001 From: Timothy Batt Date: Mon, 5 Jun 2023 22:05:29 -0400 Subject: [PATCH 09/13] test if `UploadedFile::clientPath()` returns `null` on versions below 8.1 --- tests/system/HTTP/Files/FileCollectionTest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/system/HTTP/Files/FileCollectionTest.php b/tests/system/HTTP/Files/FileCollectionTest.php index d79032e26b5e..576227ab72e4 100644 --- a/tests/system/HTTP/Files/FileCollectionTest.php +++ b/tests/system/HTTP/Files/FileCollectionTest.php @@ -55,8 +55,13 @@ public function testAllReturnsValidSingleFile() $this->assertInstanceOf(UploadedFile::class, $file); $this->assertSame('someFile.txt', $file->getName()); - $this->assertSame('someDir/someFile.txt', $file->getClientPath()); $this->assertSame(124, $file->getSize()); + + if (version_compare(PHP_VERSION, '8.1', '>=')) { + $this->assertSame('someDir/someFile.txt', $file->getClientPath()); + } else { + $this->assertNull($file->getClientPath()); + } } public function testAllReturnsValidMultipleFilesSameName() From 43fc0e00d5986d4634ce5085c43a891fcb13dd02 Mon Sep 17 00:00:00 2001 From: Timothy Batt Date: Mon, 5 Jun 2023 22:34:09 -0400 Subject: [PATCH 10/13] added proper tests for `UploadedFile::getClientPath()` --- .../system/HTTP/Files/FileCollectionTest.php | 52 ++++++++++++++----- 1 file changed, 40 insertions(+), 12 deletions(-) diff --git a/tests/system/HTTP/Files/FileCollectionTest.php b/tests/system/HTTP/Files/FileCollectionTest.php index 576227ab72e4..7c087e07d18a 100644 --- a/tests/system/HTTP/Files/FileCollectionTest.php +++ b/tests/system/HTTP/Files/FileCollectionTest.php @@ -38,12 +38,11 @@ public function testAllReturnsValidSingleFile() { $_FILES = [ 'userfile' => [ - 'name' => 'someFile.txt', - 'type' => 'text/plain', - 'size' => '124', - 'tmp_name' => '/tmp/myTempFile.txt', - 'full_path' => 'someDir/someFile.txt', - 'error' => 0, + 'name' => 'someFile.txt', + 'type' => 'text/plain', + 'size' => '124', + 'tmp_name' => '/tmp/myTempFile.txt', + 'error' => 0, ], ]; @@ -56,12 +55,6 @@ public function testAllReturnsValidSingleFile() $this->assertSame('someFile.txt', $file->getName()); $this->assertSame(124, $file->getSize()); - - if (version_compare(PHP_VERSION, '8.1', '>=')) { - $this->assertSame('someDir/someFile.txt', $file->getClientPath()); - } else { - $this->assertNull($file->getClientPath()); - } } public function testAllReturnsValidMultipleFilesSameName() @@ -460,6 +453,41 @@ public function testErrorWithNoError() $this->assertSame(UPLOAD_ERR_OK, $file->getError()); } + public function testClientPathReturnsValidFullPath() + { + $_FILES = [ + 'userfile' => [ + 'name' => 'someFile.txt', + 'type' => 'text/plain', + 'size' => '124', + 'tmp_name' => '/tmp/myTempFile.txt', + 'full_path' => 'someDir/someFile.txt', + ], + ]; + + $collection = new FileCollection(); + $file = $collection->getFile('userfile'); + + $this->assertSame('someDir/someFile.txt', $file->getClientPath()); + } + + public function testClientPathReturnsNullWhenFullPathIsNull() + { + $_FILES = [ + 'userfile' => [ + 'name' => 'someFile.txt', + 'type' => 'text/plain', + 'size' => '124', + 'tmp_name' => '/tmp/myTempFile.txt', + ], + ]; + + $collection = new FileCollection(); + $file = $collection->getFile('userfile'); + + $this->assertNull($file->getClientPath()); + } + public function testFileReturnsValidSingleFile() { $_FILES = [ From 6dbfa76387b5eec6b15667383e9a281d70f60eb0 Mon Sep 17 00:00:00 2001 From: "T.R.M. Batt" <73239367+JamminCoder@users.noreply.github.com> Date: Mon, 5 Jun 2023 22:37:34 -0400 Subject: [PATCH 11/13] add `version added` to new method Co-authored-by: kenjis --- user_guide_src/source/libraries/uploaded_files.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/user_guide_src/source/libraries/uploaded_files.rst b/user_guide_src/source/libraries/uploaded_files.rst index 13b9f9f12aca..6a981100696b 100644 --- a/user_guide_src/source/libraries/uploaded_files.rst +++ b/user_guide_src/source/libraries/uploaded_files.rst @@ -307,6 +307,8 @@ version, use ``getMimeType()`` instead: getClientPath() --------------- +.. versionadded:: 4.4.0 + Returns the `webkit relative path `_ of the uploaded file when the client has uploaded files via directory upload. In PHP versions below 8.1, this returns ``null`` From 5e86bd1a73f41ee52bf3518d3c573275d48e57dd Mon Sep 17 00:00:00 2001 From: Timothy Batt Date: Mon, 5 Jun 2023 22:45:14 -0400 Subject: [PATCH 12/13] added change description for `UploadedFile` --- user_guide_src/source/changelogs/v4.4.0.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/user_guide_src/source/changelogs/v4.4.0.rst b/user_guide_src/source/changelogs/v4.4.0.rst index f0d803b7e36e..c79e9fb56571 100644 --- a/user_guide_src/source/changelogs/v4.4.0.rst +++ b/user_guide_src/source/changelogs/v4.4.0.rst @@ -89,6 +89,9 @@ Libraries the actual validated data. See :ref:`validation-getting-validated-data` for details. - **Images:** The option ``$quality`` can now be used to compress WebP images. +- **Uploaded Files:** Added ``UploadedFiles::getClientPath()`` method that returns + the value of the `full_path` index of the file if it was uploaded via directory upload. + Helpers and Functions ===================== From 0b5965496e56d21ab68c147df43763a05bff2ff2 Mon Sep 17 00:00:00 2001 From: Timothy Batt Date: Thu, 8 Jun 2023 10:17:08 -0400 Subject: [PATCH 13/13] order variable assingment to match parameter order --- system/HTTP/Files/UploadedFile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/HTTP/Files/UploadedFile.php b/system/HTTP/Files/UploadedFile.php index 44c45571187a..70ece748d834 100644 --- a/system/HTTP/Files/UploadedFile.php +++ b/system/HTTP/Files/UploadedFile.php @@ -90,12 +90,12 @@ class UploadedFile extends File implements UploadedFileInterface public function __construct(string $path, string $originalName, ?string $mimeType = null, ?int $size = null, ?int $error = null, ?string $clientPath = null) { $this->path = $path; - $this->clientPath = $clientPath; $this->name = $originalName; $this->originalName = $originalName; $this->originalMimeType = $mimeType; $this->size = $size; $this->error = $error; + $this->clientPath = $clientPath; parent::__construct($path, false); }