Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/site/app/webroot/services/micro-format.php
diff options
context:
space:
mode:
Diffstat (limited to 'site/app/webroot/services/micro-format.php')
-rw-r--r--site/app/webroot/services/micro-format.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/site/app/webroot/services/micro-format.php b/site/app/webroot/services/micro-format.php
index 1b812ef..cb5b44b 100644
--- a/site/app/webroot/services/micro-format.php
+++ b/site/app/webroot/services/micro-format.php
@@ -143,7 +143,13 @@ if (!empty($errors)) {
$url = FILES_HOST . '/' . $row['id'] . '/' . $files['filename'];
else
$url = SITE_URL . '/downloads/file/' . $files['file_id'] . '/' . $files['filename'];
- $size = (int)$files['size'] * 1024;
+
+ $size = filesize(PUBLIC_STAGING_PATH . "/{$row['id']}/{$files['filename']}");
+ if (!$size)
+ $size = filesize(REPO_PATH . "/{$row['id']}/{$files['filename']}");
+ if (!$size)
+ $size = (int)$files['size'] * 1024;
+
if ($row['name'])
$name = $row['name'];
else