Use encodeURIComponent instead of CGI::escape when output is sent to browser.
This commit is contained in:
@@ -136,7 +136,7 @@ module Precious
|
|||||||
mustache :edit
|
mustache :edit
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
redirect to("/create/#{CGI.escape(@name)}")
|
redirect to("/create/#{encodeURIComponent(@name)}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -354,7 +354,7 @@ module Precious
|
|||||||
file.raw_data
|
file.raw_data
|
||||||
else
|
else
|
||||||
page_path = [path, name].compact.join('/')
|
page_path = [path, name].compact.join('/')
|
||||||
redirect to("/create/#{CGI.escape(page_path).gsub('%2F','/')}")
|
redirect to("/create/#{encodeURIComponent(page_path).gsub('%2F','/')}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ module Gollum
|
|||||||
def process_headers(doc)
|
def process_headers(doc)
|
||||||
toc = nil
|
toc = nil
|
||||||
doc.css('h1,h2,h3,h4,h5,h6').each do |h|
|
doc.css('h1,h2,h3,h4,h5,h6').each do |h|
|
||||||
id = CGI::escape(h.content.gsub(' ','-'))
|
id = encodeURIComponent(h.content.gsub(' ','-'))
|
||||||
level = h.name.gsub(/[hH]/,'').to_i
|
level = h.name.gsub(/[hH]/,'').to_i
|
||||||
|
|
||||||
# Add anchors
|
# Add anchors
|
||||||
|
|||||||
Reference in New Issue
Block a user