Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2648052
D25352.1732390971.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
D25352.1732390971.diff
View Options
diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php
--- a/src/applications/files/storage/PhabricatorFile.php
+++ b/src/applications/files/storage/PhabricatorFile.php
@@ -287,7 +287,7 @@
// NOTE: Once we receive the first chunk, we'll detect its MIME type and
// update the parent file if a MIME type hasn't been provided. This matters
// for large media files like video.
- $mime_type = idx($params, 'mime-type');
+ $mime_type = idx($params, 'mime-type', '');
if (!strlen($mime_type)) {
$file->setMimeType('application/octet-stream');
}
diff --git a/src/applications/files/storage/__tests__/PhabricatorFileTestCase.php b/src/applications/files/storage/__tests__/PhabricatorFileTestCase.php
--- a/src/applications/files/storage/__tests__/PhabricatorFileTestCase.php
+++ b/src/applications/files/storage/__tests__/PhabricatorFileTestCase.php
@@ -532,4 +532,11 @@
$this->assertEqual(array(), $alternate_c);
}
+ public function testNewChunkedFile() {
+ $engine = new PhabricatorTestStorageEngine();
+ $file = PhabricatorFile::newChunkedFile($engine, 10, []);
+ $this->assertTrue($file instanceof PhabricatorFile,
+ pht('newChunkedFile returns a PhabricatorFile'));
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 19:42 (18 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
989325
Default Alt Text
D25352.1732390971.diff (1 KB)
Attached To
Mode
D25352: Fix PHP 8.1 strlen(null) error in PhabricatorFile::newChunkedFile()
Attached
Detach File
Event Timeline
Log In to Comment