- 🇮🇳India Vivek Panicker Kolkata
vivek panicker → made their first commit to this issue’s fork.
- Merge request !7Issue #2918410: Added min length of keyword to be inserted into the database. → (Open) created by Vivek Panicker
There is a use case for only saving search results that actually return at least one hit. Otherwise a malicious user could affect a publicly visible "top searches" block by searching for curse words (or the competitor's brand name).
To fix this, we could have a checkbox on a settings page that lets the site admin choose whether all searches should be saved or only the ones that return a hit.
The potential problem with this solution is that some undesirable words might still return a hit and would be unaffected by the additional requirement.
* Move saving to db from hook_search_api_query_alter to hook_search_api_results_alter
* Create a settings page for indicating whether searches should be saved only if a result was returned
* Get access to query through ReslutSetInterface::getQuery in order to be able to save the search keys
I am going to throw together a patch for this, but I welcome your input. Please stop me if this has already been planned / discussed.
Needs work
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
vivek panicker → made their first commit to this issue’s fork.