Skip to content

Commit ab55687

Browse files
committed
Ignore original_script_name query parameter in generated URLs
Ref. ec9b985
1 parent 16db678 commit ab55687

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/will_paginate/view_helpers/action_view.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def infer_collection_from_controller
9999
class LinkRenderer < ViewHelpers::LinkRenderer
100100
protected
101101

102-
GET_PARAMS_BLACKLIST = [:script_name]
102+
GET_PARAMS_BLACKLIST = [:script_name, :original_script_name]
103103

104104
def default_url_params
105105
{}

spec/view_helpers/action_view_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def renderer.gap() '<span class="my-gap">~~</span>' end
203203
end
204204

205205
it "doesn't allow tampering with script_name" do
206-
request.params :script_name => 'p0wned'
206+
request.params :script_name => 'p0wned', :original_script_name => 'p0wned'
207207
paginate
208208
assert_links_match %r{^/foo/bar}
209209
assert_no_links_match /p0wned/

0 commit comments

Comments
 (0)