Defect #15885
openRedirection of a wikipage with a %-sign seems to be broken
0%
Description
In an older verion of Redmine i created some wiki-pages with a %-sign in the title. After i updated Redmine to version 2.4.1-stable i get the following error:
Bad Request
bad URI `/projects/testproject/wiki/Blabla_Cr%C3%A8me_20%?parent=Wiki'.
WEBrick/1.3.1 (Ruby/2.0.0/2013-11-22) at rubyonrails:82
I can still open the page when i put '25' behind the %-sign in the URL:
This breaks: http://172.26.3.90:82/projects/testproject/wiki/Blabla_Cr%C3%A8me_20%?parent=Wiki
This works: http://172.26.3.90:82/projects/testproject/wiki/Blabla_Cr%C3%A8me_20%25?parent=Wiki
Can this be a URL-encoding bug in Redmine?
Updated by Remco Kl almost 11 years ago
I reproduced the problem on the demo.redmine.org:
http://demo.redmine.org/projects/url-sign-test/wiki/Blablabla_cr%C3%A8me_20%?parent=Wiki
Updated by Remco Kl almost 11 years ago
I've added a quick-fix to the application_helper.rb (around line 640) which fix the biggest problem for now:
case options[:wiki_links] when :local; "#{page.present? ? Wiki.titleize(page) : ''}.html" + (anchor.present? ? "##{anchor}" : '') when :anchor; "##{page.present? ? Wiki.titleize(page) : title}" + (anchor.present? ? "_#{anchor}" : '') # used for single-file wiki export else wiki_page_id = page.present? ? Wiki.titleize(page) : nil # Added manually to quick-fix the following defect: http://www.redmine.org/issues/15885 wiki_page_id.gsub!('%','%25') parent = wiki_page.nil? && obj.is_a?(WikiContent) && obj.page && project == link_project ? obj.page.title : nil url_for(:only_path => only_path, :controller => 'wiki', :action => 'show', :project_id => link_project, :id => wiki_page_id, :version => nil, :anchor => anchor, :parent => parent)
This (wiki_page_id.gsub!('%','%25')) works only for opening wiki-links containing a percent-sign in the URL:
[[Test 25%]]