summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/mime.default.php2
-rw-r--r--plugins/storage.bitfile.php1
-rw-r--r--templates/mime_meta_inc.tpl4
3 files changed, 4 insertions, 3 deletions
diff --git a/plugins/mime.default.php b/plugins/mime.default.php
index b836b00..719feca 100644
--- a/plugins/mime.default.php
+++ b/plugins/mime.default.php
@@ -274,7 +274,7 @@ if( !function_exists( 'mime_default_load' )) {
}
// legacy table data was named storage path and included a partial path. strip out any path just in case
- $ret['file_name'] = basename( $row['file_name'] );
+ $ret['file_name'] = $storageName;
$ret['preferences'] = $pPrefs;
// some stuff is only available if we have a source file
diff --git a/plugins/storage.bitfile.php b/plugins/storage.bitfile.php
index 8e1e999..60601af 100644
--- a/plugins/storage.bitfile.php
+++ b/plugins/storage.bitfile.php
@@ -98,6 +98,7 @@ function bit_files_load( $pRow ) {
INNER JOIN `".BIT_DB_PREFIX."liberty_files` lf ON (lf.`file_id` = la.`foreign_id`)
WHERE la.`foreign_id` = ? AND `attachment_plugin_guid` = ?";
if( $ret = $gBitSystem->mDb->getRow( $query, array( $pRow['foreign_id'], PLUGIN_GUID_BIT_FILES ))) {
+ $ret['file_name'] = basename( $ret['file_name'] );
$ret['source_file'] = liberty_mime_get_source_file( $ret );
$canThumbFunc = liberty_get_function( 'can_thumbnail' );
if( $canThumbFunc( $ret['mime_type'] )) {
diff --git a/templates/mime_meta_inc.tpl b/templates/mime_meta_inc.tpl
index a8ff434..d0ff071 100644
--- a/templates/mime_meta_inc.tpl
+++ b/templates/mime_meta_inc.tpl
@@ -10,14 +10,14 @@
<div class="row">
{formlabel label="View" for=""}
{forminput}
- <a href="{$attachment.display_url}">{$attachment.filename}</a>
+ <a href="{$attachment.display_url}">{$attachment.file_name}</a>
{/forminput}
</div>
{elseif $attachment.download_url}
<div class="row">
{formlabel label="Download" for=""}
{forminput}
- <a href="{$attachment.download_url}">{$attachment.filename}</a> <small>({$attachment.mime_type} &bull; {$attachment.file_size|display_bytes})</small>
+ <a href="{$attachment.download_url}">{$attachment.file_name}</a> <small>({$attachment.mime_type} &bull; {$attachment.file_size|display_bytes})</small>
{/forminput}
</div>
{/if}