lib/pdfkit/source.rb in pdfkit-0.8.7.1 vs lib/pdfkit/source.rb in pdfkit-0.8.7.2
- old
+ new
@@ -27,11 +27,11 @@
def to_input_for_command
if file?
@source.path
elsif url?
- %{"#{shell_safe_url}"}
+ escaped_url
else
SOURCE_FROM_STDIN
end
end
@@ -39,10 +39,10 @@
file? ? @source.path : @source
end
private
- def shell_safe_url
+ def escaped_url
url_needs_escaping? ? URI::DEFAULT_PARSER.escape(@source) : @source
end
def url_needs_escaping?
URI::DEFAULT_PARSER.escape(URI::DEFAULT_PARSER.unescape(@source)) != @source