プロジェクト

全般

プロフィール

Vote #74813

未完了

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

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Wiki_1
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
1
version_id:
0
issue_org_id:
15885
author_id:
93616
assigned_to_id:
0
comments:
2
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
76
ステータス-->[New]

説明

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?


journals

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
--------------------------------------------------------------------------------
I've added a quick-fix to the application_helper.rb (around line 640) which fix the biggest problem for now:

<pre>
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)

</pre>

This (wiki_page_id.gsub!('%','%25')) works only for opening wiki-links containing a percent-sign in the URL:

<pre>
[[Test 25%]]
</pre>
--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリWiki_1 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0