You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@mw44118 - my workaround is to double-urlencode all values before setting them in the URL, and decode them when using pagerjs's params. This means that the values are decoded twice; once by pagerjs (and put into the page param observables), then a second time by you in order to get the real value. It's not pretty, and the URLs get a bit longer, but it does work safely (since chars like & that mess up pagerjs are encoded & hidden from pagerjs). Also (probably) fixes any other potential param encoding bugs (like ? and = and who knows what else).
Ideally we'll get a fix in pagerjs. I tried, but it quickly became large (ie. the current code parses way too early in the stack, and we need to pass additional parameters through a lot of functions in order to decode at the right point). It's not too complex, but not something I had time to finish unfortunately :(
Bug
I'm running into this bug right now with pagerjs 1.0.1. I use a page-href like this:
On the page, we have this:
Note that param1 is truncated to where the ampersand is in the value.
Cause
The problem appears to be here
That turns this URL:
Into this:
The problem is that we're decoding the %26 into & too early. Now instead of "param1" having the value "first & second", we have these params:
Fix
Instead of decoding the entire URL in parseHash, we need to be more selective.
This will preserve ampersands in values w/o messing up the param splitting.
The text was updated successfully, but these errors were encountered: