From fab013b19ba92c7d8d8ec2f1225729e8ffb78ee4 Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Tue, 20 Apr 2021 17:20:16 +0200 Subject: [PATCH] Fix file name sanitization in PDF previewer [SCI-5541] --- app/jobs/pdf_preview_job.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/jobs/pdf_preview_job.rb b/app/jobs/pdf_preview_job.rb index 8ed34ecc9..6c9bcd19b 100644 --- a/app/jobs/pdf_preview_job.rb +++ b/app/jobs/pdf_preview_job.rb @@ -25,7 +25,7 @@ class PdfPreviewJob < ApplicationJob ActiveRecord::Base.transaction do success = system( - "#{libreoffice_path} --headless --invisible --convert-to pdf --outdir #{work_dir} #{input.path}" + libreoffice_path, '--headless', '--invisible', '--convert-to', 'pdf', '--outdir', work_dir, input.path ) unless success && File.file?(preview_file) raise StandardError, "There was an error generating PDF preview, blob id: #{blob.id}"