Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Unicode url params. #95

Closed
wants to merge 1 commit into from

2 participants

@twoism

I added a fix that we needed at Posterous. URLs like: http://foo.posterous.com/?tag=沖縄南部&page=XX always returned page=2 for any generated link past page 1. It seems that multi-byte chars were not being accounted for when replacing the '@' with the page number.

@mislav
Owner

Hey, sorry this hasn't got any attention. I didn't pull the change because it requires mb_chars and will_paginate supports Rails versions that are older than multibyte features.

However since people don't seem to run into this problem, I'll close this right now without fixing. The new will_paginate for Rails 3 doesn't suffer from this bug, anyway.

Thanks!

@mislav mislav closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/will_paginate/view_helpers.rb
View
6 lib/will_paginate/view_helpers.rb
@@ -343,9 +343,9 @@ def url_for(page)
else
@url_string = url
@url_params[param_name] = 3
- @template.url_for(@url_params).split(//).each_with_index do |char, i|
- if char == '3' and url[i, 1] == '2'
- @url_string[i] = "\0"
+ @template.url_for(@url_params).mb_chars.split(//).each_with_index do |char, i|
+ if char.to_s == '3' and url.mb_chars[i, 1].to_s == '2'
+ @url_string.mb_chars[i] = "\0"
break
end
end
Something went wrong with that request. Please try again.