Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encode article title in WikiWho API access #188

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

ChlodAlejandro
Copy link
Contributor

The article title is not URL encoded when the WikiWho API URL is being constructed (Api.js#getAjaxURL). This causes any article with a question mark to have a URL containing query parameters starting wherever the question mark is.

Most prominent issue is when viewing an article with a title that ends with a question mark, where the title without the question mark removed (practically always a redirect) shows up instead of the actual article.

Before After
image Screen Shot 2024-04-01 at 23 40 37

Revision ID left unencoded since it's expected to be a number, which won't have any special characters that need encoding.

Initially reported by Your Power on Discord.

@ChlodAlejandro
Copy link
Contributor Author

Looks like I forgot to fix a test (and write a new one). 😔 I'll do this in the morning (~8 hours), if it hasn't been resolved by then.

The article title is not URL encoded when the WikiWho API URL is
being constructed (Api.js#getAjaxURL). This causes any article with
a question mark to have a URL containing query parameters starting
wherever the question mark is.
@ChlodAlejandro
Copy link
Contributor Author

Should be fixed now. I've ensured that the test here now uses encoded paths and also added a test to check if special characters are encoded.

Copy link
Member

@MusikAnimal MusikAnimal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic! I'm really surprised this bug hasn't surfaced until now, hehe. Thanks for fixing it, and also for a adding a test! 💯

We'll cut a new release and get this shipped soon, if not tonight (my time) then tomorrow.

@MusikAnimal MusikAnimal merged commit 677269a into wikimedia:master Apr 2, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants