Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F584955
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/includes/specials/pagers/UploadStashPager.php b/includes/specials/pagers/UploadStashPager.php
index 68b3e4cc937..f2ddde88d6f 100644
--- a/includes/specials/pagers/UploadStashPager.php
+++ b/includes/specials/pagers/UploadStashPager.php
@@ -90,6 +90,8 @@ class UploadStashPager extends TablePager {
'us_key',
'us_size',
'us_path',
+ 'us_sha1',
+ 'us_mime',
],
'conds' => [ 'us_user' => $this->getUser()->getId() ],
'options' => [],
@@ -149,7 +151,13 @@ class UploadStashPager extends TablePager {
private function getCurrentFile(): File {
$fileKey = $this->mCurrentRow->us_key;
return $this->files[$fileKey]
- ?? new UploadStashFile( $this->localRepo, $this->mCurrentRow->us_path, $fileKey );
+ ?? new UploadStashFile(
+ $this->localRepo,
+ $this->mCurrentRow->us_path,
+ $fileKey,
+ $this->mCurrentRow->us_sha1,
+ $this->mCurrentRow->us_mime ?? false
+ );
}
/**
diff --git a/includes/upload/UploadStash.php b/includes/upload/UploadStash.php
index 42f1180205c..5c72be0307c 100644
--- a/includes/upload/UploadStash.php
+++ b/includes/upload/UploadStash.php
@@ -549,7 +549,8 @@ class UploadStash {
$this->repo,
$this->fileMetadata[$key]['us_path'],
$key,
- $this->fileMetadata[$key]['us_sha1']
+ $this->fileMetadata[$key]['us_sha1'],
+ $this->fileMetadata[$key]['us_mime'] ?? false
);
if ( $file->getSize() === 0 ) {
throw new UploadStashZeroLengthFileException(
diff --git a/includes/upload/UploadStashFile.php b/includes/upload/UploadStashFile.php
index 4a051b60d36..ce3c6ed1572 100644
--- a/includes/upload/UploadStashFile.php
+++ b/includes/upload/UploadStashFile.php
@@ -45,10 +45,11 @@ class UploadStashFile extends UnregisteredLocalFile {
* @param string $path Path to file
* @param string $key Key to store the path and any stashed data under
* @param string|null $sha1 SHA1 of file. Will calculate if not set
+ * @param string|false $mime Mime type of file. Will calculate if not set
* @throws UploadStashBadPathException
* @throws UploadStashFileNotFoundException
*/
- public function __construct( $repo, $path, $key, $sha1 = null ) {
+ public function __construct( $repo, $path, $key, $sha1 = null, $mime = false ) {
$this->fileKey = $key;
$this->sha1 = $sha1;
@@ -79,7 +80,7 @@ class UploadStashFile extends UnregisteredLocalFile {
}
}
- parent::__construct( false, $repo, $path, false );
+ parent::__construct( false, $repo, $path, $mime );
$this->name = basename( $this->path );
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Jul 5, 5:31 AM (10 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
227431
Default Alt Text
(2 KB)
Attached To
Mode
rMW mediawiki
Attached
Detach File
Event Timeline
Log In to Comment