mwdb-core
mwdb-core copied to clipboard
Four backslashes needed to query configuration value with single backslash
Environment information
- MWDB version (from
/about): 2.7.0 - Installation method:
- [x] mwdb.cert.pl service
- [ ] From PyPi (
pip install mwdb-core) - [ ] From docker-compose
- [ ] Other (please explain)
- Plugins installed: unrelevant
Behaviour the bug (what happened?)
Backslash needs to be escaped two times to work correctly in configuration search
Configuration:
{
"pdb_path": "C:\\xxxx\\12345678.pdb"
}
Working lucene query for pdb_path field:
cfg.pdb_path:"C:\\\\xxxx\\\\12345678.pdb"
Expected behaviour
Backslash should be unescaped once:
cfg.pdb_path:"C:\\xxxx\\12345678.pdb"
Possibly caused by additional unicode_escape in database. I think it's completely unnecessary for JSONB and if it's added because there were issues with non-ascii characters, we need to find a more transparent solution.
See also: https://github.com/CERT-Polska/mwdb-core/blob/master/mwdb/model/config.py#L44