mysociety / popit

DEPRECATED - Development on PopIt has stopped and it is no longer being maintained
https://goo.gl/Vvej4Q
Other
76 stars 33 forks source link

Question mark not URL encoded #769

Closed tmtmtmtm closed 9 years ago

tmtmtmtm commented 9 years ago

When a Person has a question mark in their ID, then trying to follow links to that Person in the UI fails, as it doesn't get URL encoded.

So, for example, the first Person link on http://welshassembly.popit.staging.mysociety.org/ goes to http://welshassembly.popit.staging.mysociety.org/persons/http://www.senedd.assemblywales.org/mgUserInfo.aspx?UID=154, and fails, rather than http://welshassembly.popit.staging.mysociety.org/persons/http://www.senedd.assemblywales.org/mgUserInfo.aspx%3FUID=154 (which would succeed)

tmtmtmtm commented 9 years ago

It would be useful to know how much effort is involved in fixing this one. If it's going to be awkward and convoluted, then I could do something in the meantime to work around anyone creating data like this openpoliticians; but if it's fairly easy, then it would be cleaner (and more correct) to fix in PopIt.

chrismytton commented 9 years ago

Just noticed that this is also an issue in the UI with links to the api (Get this data) and in the API with the url and html_url properties. So those places also need to have the record id run though encodeURIComponent before being included in a url.

chrismytton commented 9 years ago

Ok this is all fixed now and deployed to production.