josecebe / twbs-pagination

jQuery pagination plugin (bootstrap powered)
http://josecebe.github.io/twbs-pagination/
Other
1.1k stars 401 forks source link

Issue when the URL got a space or a querystring variable with space or %20 #127

Closed JosephSKh closed 7 years ago

JosephSKh commented 8 years ago

There's an issue if the URL got a space or %20, the active page is not correct and always set to (1)

test a URL like this "www.example.com?page=7&var=a a"

SOLVED BY: replacing:

var match, regexp = this.options.href.replace(/[-\/\\^$*+?.|[\]]/g, '\\$&');

with

var match, regexp = this.options.href.replace(/[-\/\\^$*+?.|[\]]/g, '\\$&').replace(' ','%20');

tonarii commented 8 years ago

Hi JosephSKh, thanks for your solution ! But i'm still having an issue, this is working for a two words search but this is not working for a 3 words search or more. Do you have any idea how to correct that ? Thanks. Regards.

EDIT : SOLVED :)

JosephSKh commented 8 years ago

@tonarii Glad you solved it man and sorry for the late reply,, Hope it helped :) Also, you can post your solution for others

Thank you :)

tonarii commented 8 years ago

@JosephSKh Hi, no problem and thanks for your answer. Actually i used the solution posted by AnchorRen : https://github.com/esimakin/twbs-pagination/issues/125

And that worked for me :)

eugenesimakin commented 7 years ago

Fixed. Closed