strapi / strapi

🚀 Strapi is the leading open-source headless CMS. It’s 100% JavaScript/TypeScript, fully customizable, and developer-first.
https://strapi.io
Other
63.66k stars 8.1k forks source link

Filter by text field with "&" symbol doesn't work #20271

Closed amazhukin closed 1 month ago

amazhukin commented 6 months ago

Bug report

Required System information

Describe the bug

Filter by text field with "&" symbol doesn't work. Search string is cut up to & symbol and no results with "is" operand

Steps to reproduce the behavior

  1. Create any entity at collection type that text field contains ampersand (&) symbol. Eg, create article with title "Test article & issue reproduce" image
  2. Go to list of collection type and using "Filters" button select text field, "is" operand and text with & symbol image
  3. Click "Add filter"
  4. Check what filter is applied image

Expected behavior

Filter should be applied correctly and display found record, like if there are no & symbol in search: image

Additional context

Some details from network tab: Request URL: http://127.0.0.1:1337/content-manager/collection-types/api::article.article?page=1&pageSize=10&sort=title:ASC&filters[$and][0][title][$eq]=Test%20article%20&%20issue%20reproduce= Query parameters that applied:

page: 1
pageSize: 10
sort: title:ASC
filters[$and][0][title][$eq]: Test article 
 issue reproduce: 

image

simotae14 commented 1 month ago

I am gonna close it because it was fixed with this PR https://github.com/strapi/strapi/pull/21406