Fix file name sanitization in PDF previewer [SCI-5541]

This commit is contained in:
Oleksii Kriuchykhin 2021-04-20 17:20:16 +02:00
parent a6b2b23800
commit fab013b19b

View file

@ -25,7 +25,7 @@ class PdfPreviewJob < ApplicationJob
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
success = system( 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) unless success && File.file?(preview_file)
raise StandardError, "There was an error generating PDF preview, blob id: #{blob.id}" raise StandardError, "There was an error generating PDF preview, blob id: #{blob.id}"