From 8d5448601b74dd1175b31224200de0768d1e0856 Mon Sep 17 00:00:00 2001 From: George <31376482+george-gca@users.noreply.github.com> Date: Sun, 29 Dec 2024 22:42:28 -0300 Subject: [PATCH] Security fixes for download-3rd-party --- _plugins/download-3rd-party.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_plugins/download-3rd-party.rb b/_plugins/download-3rd-party.rb index 30bc1c6..0b9d88b 100644 --- a/_plugins/download-3rd-party.rb +++ b/_plugins/download-3rd-party.rb @@ -92,7 +92,7 @@ Jekyll::Hooks.register :site, :after_init do |site| unless File.directory?(dest) && !Dir.empty?(dest) puts "Downloading fonts from #{url} to #{dest}" # get available fonts from the url - doc = Nokogiri::HTML(URI.open(url, "User-Agent" => "Ruby/#{RUBY_VERSION}")) + doc = Nokogiri::HTML(URI(url).open("User-Agent" => "Ruby/#{RUBY_VERSION}")) doc.css('a').each do |link| # get the file name from the url file_name = link['href'].split('/').last.split('?').first @@ -116,7 +116,7 @@ Jekyll::Hooks.register :site, :after_init do |site| unless File.directory?(dest) && !Dir.empty?(dest) puts "Downloading images from #{url} to #{dest}" # get available fonts from the url - doc = Nokogiri::HTML(URI.open(url, "User-Agent" => "Ruby/#{RUBY_VERSION}")) + doc = Nokogiri::HTML(URI(url).open("User-Agent" => "Ruby/#{RUBY_VERSION}")) doc.xpath('/html/body/div/div[3]/table/tbody/tr/td[1]/a').each do |link| # get the file name from the url file_name = link['href'].split('/').last.split('?').first