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

Sanitize the term slugs before query them for non ASCII characters slugs case #2948

Merged
merged 3 commits into from
Aug 25, 2022

Conversation

alaa-alshamy
Copy link
Contributor

@alaa-alshamy alaa-alshamy commented Aug 15, 2022

Description of the Change

If there's a taxonomy terms that have a non ASCII characters and we are trying to filter the posts or getting the term info by this term slug the Elasticsearch will return nothing because the non ASCII slugs are saved in the WordPress and Elasticsearch as following:

In WordPress database:
Screenshot from 2022-08-15 13-47-14

In Elasticsearch:
Screenshot from 2022-08-15 13-48-36

So comparing via slug without sanitizing will be wrong.

Closes #

How to test the Change

If trying to filter the posts list in the admin dashboard via a term that has a non ASCII characters in its slug will got empty result even if there's posts linked with this term, this is an example url:
www.example.com/wp-admin/edit.php?category_name=غير-مصنف

Changelog Entry

Fixed - Bug fix

Credits

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@felipeelia felipeelia added this to the 4.3.0 milestone Aug 23, 2022
@felipeelia felipeelia merged commit 8702ae0 into 10up:develop Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants