summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhashworks <mail@hashworks.net>2017-07-10 20:38:34 +0200
committerFlorian Pritz <bluewind@xinu.at>2017-07-11 10:20:05 +0200
commit5674bd05d10a91c1e70d03fed419379b7a5ed0c8 (patch)
tree5c9dbfacbb0b6fd46ea612b55b21a75f225e425d
parentb253c9a893077711e503c69970b24ae94e7451ac (diff)
Actually update filesize with update_file_metadata
According to `application/controllers/tools.php#L32` the `update_file_metadata` tool should update the mimetype AND the filesize, but the latter never got implemented.
-rw-r--r--application/controllers/file/file_default.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/application/controllers/file/file_default.php b/application/controllers/file/file_default.php
index f4f106990..9ef7d0880 100644
--- a/application/controllers/file/file_default.php
+++ b/application/controllers/file/file_default.php
@@ -971,11 +971,14 @@ class File_default extends MY_Controller {
foreach ($query as $key => $item) {
$data_id = $item["hash"].'-'.$item['id'];
- $mimetype = mimetype($this->mfile->file($data_id));
+ $filepath = $this->mfile->file($data_id);
+ $mimetype = mimetype($filepath);
+ $filesize = filesize($filepath);
$this->db->where('id', $item['id'])
->set(array(
'mimetype' => $mimetype,
+ 'filesize' => $filesize,
))
->update('file_storage');
}