Project

General

Profile

Actions

Defect #15885

open

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

Added by Remco Kl over 10 years ago. Updated about 10 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Wiki
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

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?

Actions #2

Updated by Remco Kl about 10 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%]]
Actions

Also available in: Atom PDF