diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-05-21 13:35:54 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-05-21 13:35:54 +0100 |
| commit | be38cae07c94f908428abd2a83a1a27bc1913b4f (patch) | |
| tree | 6bfaf5dc66d6003663142ee75865d981ca311ae8 | |
| parent | 44962fb7588557a0e81f5f7798c00aa205e478ac (diff) | |
| download | liberty-be38cae07c94f908428abd2a83a1a27bc1913b4f.tar.gz liberty-be38cae07c94f908428abd2a83a1a27bc1913b4f.tar.bz2 liberty-be38cae07c94f908428abd2a83a1a27bc1913b4f.zip | |
Clean up temp pdftotext .txt file after text extraction
The extracted .txt file was left in the upload directory after
file_get_contents(). Added unlink() to remove it immediately.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| -rw-r--r-- | plugins/mime.pdf.php | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/plugins/mime.pdf.php b/plugins/mime.pdf.php index 2a6ce51..6035ccb 100644 --- a/plugins/mime.pdf.php +++ b/plugins/mime.pdf.php @@ -172,6 +172,7 @@ function mime_pdf_text_extract( &$pFileHash ) { $pdftotextcommand = $pdftotext. " \"$source\" \"$source.txt\" "; shell_exec( $pdftotextcommand ); $pFileHash['data'] = file_get_contents($source.'.txt'); + @unlink( $source.'.txt' ); } else { $pFileHash['log']['pdftotext'] = "PDF to Text function not installed."; } |
