Skip to content

Commit

Permalink
Remove zarex dep, use unaltered filename provided by user
Browse files Browse the repository at this point in the history
Use filename provided by user without sanitizing when creating PDF
  • Loading branch information
praveenperera committed Jun 6, 2017
1 parent 3512a83 commit a09962e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/pdf_generator.ex
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ defmodule PdfGenerator do
end

# return file name of generated pdf
# requires: Porcelain, Misc.Random, zarex
# requires: Porcelain, Misc.Random

@doc """
Generates a pdf file from given html string. Returns a string containing a
Expand Down Expand Up @@ -158,7 +158,7 @@ defmodule PdfGenerator do
end

defp generate_filebase(nil), do: generate_filebase(Misc.Random.string)
defp generate_filebase(filename), do: Path.join(System.tmp_dir, Zarex.sanitize(filename))
defp generate_filebase(filename), do: Path.join(System.tmp_dir, filename)

def encrypt_pdf( pdf_input_path, user_pw, owner_pw ) do
pdftk_path = PdfGenerator.PathAgent.get.pdftk_path
Expand Down
2 changes: 0 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ defmodule PdfGenerator.Mixfile do
{:porcelain, "~> 2.0"},
# a helper
{:misc_random, ">=0.2.6" },
# filename sanitizer
{:zarex, "~> 0.2"},
# generate docs
{:earmark, "~> 0.1", only: :dev},
{:ex_doc, "~> 0.7", only: :dev}
Expand Down

0 comments on commit a09962e

Please sign in to comment.