Defect #15885

Redirection of a wikipage with a %-sign seems to be broken

Added by Remco Kl almost 9 years ago. Updated almost 9 years ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:


Target version:-
Resolution: Affected version:2.4.1


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:

This works:

Can this be a URL-encoding bug in Redmine?


#2 Updated by Remco Kl almost 9 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
              wiki_page_id = page.present? ? Wiki.titleize(page) : nil

              # Added manually to quick-fix the following defect:

              parent = wiki_page.nil? && obj.is_a?(WikiContent) && && project == link_project ? : 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%]]

Also available in: Atom PDF