plone.restapi icon indicating copy to clipboard operation
plone.restapi copied to clipboard

Escape some chars in search parameters

Open cekk opened this issue 4 years ago • 8 comments

This is related to this post.

Is a common problem with ZTCTextIndex and this pr will try to fix the problem with searches made with plone.restapi only.

The regexp right now only remove parenthesis from the value. Do we need to manage also other characters?

cekk avatar Aug 30 '21 11:08 cekk

@cekk thanks for creating this Pull Request and help improve Plone!

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass.

Whenever you feel that the pull request is ready to be tested, either start all jenkins jobs pull requests by yourself, or simply add a comment in this pull request stating:

@jenkins-plone-org please run jobs

With this simple comment all the jobs will be started automatically.

Happy hacking!

mister-roboto avatar Aug 30 '21 11:08 mister-roboto

@jenkins-plone-org please run jobs

cekk avatar Aug 30 '21 12:08 cekk

@cekk LGTM. I am just wondering what other characters we would have to strip that would break zcatalog. Would it be possible to write a set of unit tests to just try what works and what not?

tisto avatar Aug 31 '21 06:08 tisto

@jenkins-plone-org please run jobs

tisto avatar Aug 31 '21 06:08 tisto

@tisto i improved tests but i've found some other edge cases that generate exceptions and i don't know if we want to handle or not:

  • not (already fixed in my pr and tested)
  • single chars £ $ * &, etc: ZCTextIndex returns an error if you set SearchableText with one of the special characters

cekk avatar Sep 03 '21 14:09 cekk

@jenkins-plone-org please run jobs

cekk avatar Sep 08 '21 13:09 cekk

@jenkins-plone-org please run jobs

cekk avatar Nov 18 '21 15:11 cekk

@tisto @tiberiuichim any chance to have this pr merged?

cekk avatar Nov 18 '21 15:11 cekk

I think this is no longer needed since https://github.com/plone/plone.app.querystring/issues/111 was fixed in plone.app.querystring

davisagli avatar Sep 04 '22 03:09 davisagli