Skip to content

Commit

Permalink
Escape source_name parameter on RDoc::Servlet.
Browse files Browse the repository at this point in the history
  Patch by @claudijd
  • Loading branch information
hsbt committed Mar 6, 2018
1 parent 00d6061 commit 32d9a92
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/rdoc/servlet.rb
@@ -1,5 +1,6 @@
# frozen_string_literal: true
require 'rdoc'
require 'erb'
require 'time'
require 'json'
require 'webrick'
Expand Down Expand Up @@ -427,14 +428,14 @@ def store_for source_name
end

raise WEBrick::HTTPStatus::NotFound,
"Could not find gem \"#{source_name}\". Are you sure you installed it?" unless ri_dir
"Could not find gem \"#{ERB::Util.html_escape(source_name)}\". Are you sure you installed it?" unless ri_dir

store = RDoc::Store.new ri_dir, type

return store if File.exist? store.cache_path

raise WEBrick::HTTPStatus::NotFound,
"Could not find documentation for \"#{source_name}\". Please run `gem rdoc --ri gem_name`"
"Could not find documentation for \"#{ERB::Util.html_escape(source_name)}\". Please run `gem rdoc --ri gem_name`"

end
end
Expand Down

0 comments on commit 32d9a92

Please sign in to comment.