summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-06-01 21:04:46 +0100
committerLester Caine <lester@lsces.co.uk>2026-06-01 21:04:46 +0100
commit1ecdd38e1118a9df05fc62d9f1fa1aa4cd0178b0 (patch)
tree2a4f85381f9ae9cf3670a0b08f3afbb0afa33eed /plugins
parent1634782e80dbdff8a1c0ae118a3d9fccc9892b07 (diff)
downloadliberty-1ecdd38e1118a9df05fc62d9f1fa1aa4cd0178b0.tar.gz
liberty-1ecdd38e1118a9df05fc62d9f1fa1aa4cd0178b0.tar.bz2
liberty-1ecdd38e1118a9df05fc62d9f1fa1aa4cd0178b0.zip
Fix PDF thumbnail generation — fire on upload even when source_file not yet set
mime_default_update/store don't set top-level source_file; mime_pdf_thumbnail already handles the upload hash directly, so the guard just needs to also trigger when upload is present. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mime.pdf.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/mime.pdf.php b/plugins/mime.pdf.php
index 6035ccb..27cd587 100644
--- a/plugins/mime.pdf.php
+++ b/plugins/mime.pdf.php
@@ -81,7 +81,7 @@ function mime_pdf_store( &$pStoreRow ) {
$ret = false;
}
- if( $gBitSystem->getConfig( 'pdf_thumbnails', 'y' ) == 'y' && !empty( $pStoreRow['source_file'] ) ) {
+ if( $gBitSystem->getConfig( 'pdf_thumbnails', 'y' ) == 'y' && (!empty( $pStoreRow['source_file'] ) || !empty( $pStoreRow['upload'] )) ) {
if( !mime_pdf_thumbnail( $pStoreRow )) {
// if it all goes tits up, we'll know why
$pStoreRow['errors'] = $pStoreRow['log'];
@@ -117,7 +117,7 @@ function mime_pdf_update( &$pStoreRow, $pParams = null ) {
}
}
- if( $gBitSystem->getConfig( 'pdf_thumbnails', 'y' ) == 'y' && !empty( $pStoreRow['source_file'] ) ) {
+ if( $gBitSystem->getConfig( 'pdf_thumbnails', 'y' ) == 'y' && (!empty( $pStoreRow['source_file'] ) || !empty( $pStoreRow['upload'] )) ) {
if( !mime_pdf_thumbnail( $pStoreRow )) {
// if it all goes tits up, we'll know why
$pStoreRow['errors'] = $pStoreRow['log'];