提交 2bbcff8c 编写于 作者: R Rick Olson

Fix that routes with *path segments in the recall can generate URLs. [Rick]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4454 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 36dc94a6
*SVN*
* Fix that routes with *path segments in the recall can generate URLs. [Rick]
* Fix strip_links so that it doesn't hang on multiline <acronym> tags [Jamis Buck]
* Remove problematic control chars in rescue template. #5316 [Stefan Kaes]
......
......@@ -581,7 +581,7 @@ def match_extraction(next_capture)
class PathSegment < DynamicSegment
EscapedSlash = CGI.escape("/")
def interpolation_chunk
"\#{CGI.escape(#{local_name}).gsub(#{EscapedSlash.inspect}, '/')}"
"\#{CGI.escape(#{local_name}.to_s).gsub(#{EscapedSlash.inspect}, '/')}"
end
def default
......
......@@ -214,6 +214,15 @@ def test_dynamic_path_allowed
assert_equal '/pages/boo', rs.generate(:controller => 'content', :action => 'show_file', :path => %w(pages boo))
end
def test_dynamic_recall_paths_allowed
rs.draw do |map|
map.connect '*path', :controller => 'content', :action => 'show_file'
end
recall_path = ActionController::Routing::PathSegment::Result.new(%w(pages boo))
assert_equal '/pages/boo', rs.generate({}, :controller => 'content', :action => 'show_file', :path => recall_path)
end
def test_backwards
rs.draw do |map|
map.connect 'page/:id/:action', :controller => 'pages', :action => 'show'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册