Merge pull request #3267 from okriuchykhin/ok_SCI_5541_v2

Fix file name sanitization in PDF previewer [SCI-5541]
This commit is contained in:
Miha Mencin 2021-04-20 17:24:21 +02:00 committed by GitHub
commit 2b96d59d74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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}"