mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 17:08:41 -06:00
Fixes #11555: Avoid inadvertent interpretation of search query as regular expression under global search
This commit is contained in:
parent
d5e6829eff
commit
5f7e310305
@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
## v3.4.4 (FUTURE)
|
## v3.4.4 (FUTURE)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* [#11555](https://github.com/netbox-community/netbox/issues/11555) - Avoid inadvertent interpretation of search query as regular expression under global search (previously [#11516](https://github.com/netbox-community/netbox/issues/11516))
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## v3.4.3 (2023-01-20)
|
## v3.4.3 (2023-01-20)
|
||||||
@ -34,7 +38,7 @@
|
|||||||
* [#11483](https://github.com/netbox-community/netbox/issues/11483) - Apply configured formatting to custom date fields
|
* [#11483](https://github.com/netbox-community/netbox/issues/11483) - Apply configured formatting to custom date fields
|
||||||
* [#11488](https://github.com/netbox-community/netbox/issues/11488) - Add missing `description` fields to several REST API serializers
|
* [#11488](https://github.com/netbox-community/netbox/issues/11488) - Add missing `description` fields to several REST API serializers
|
||||||
* [#11497](https://github.com/netbox-community/netbox/issues/11497) - Enforce `run_script` permission when executing scripts via REST API
|
* [#11497](https://github.com/netbox-community/netbox/issues/11497) - Enforce `run_script` permission when executing scripts via REST API
|
||||||
* [#11516](https://github.com/netbox-community/netbox/issues/11516) - Prevent text highlight utility from interpreting match as regex
|
* ~[#11516](https://github.com/netbox-community/netbox/issues/11516) - Prevent text highlight utility from interpreting match as regex~
|
||||||
* [#11522](https://github.com/netbox-community/netbox/issues/11522) - Correct tag links under contact & tenant list views
|
* [#11522](https://github.com/netbox-community/netbox/issues/11522) - Correct tag links under contact & tenant list views
|
||||||
* [#11544](https://github.com/netbox-community/netbox/issues/11544) - Catch ValidationError exception when filtering by invalid MAC address
|
* [#11544](https://github.com/netbox-community/netbox/issues/11544) - Catch ValidationError exception when filtering by invalid MAC address
|
||||||
|
|
||||||
|
@ -527,6 +527,7 @@ def highlight_string(value, highlight, trim_pre=None, trim_post=None, trim_place
|
|||||||
if type(highlight) is re.Pattern:
|
if type(highlight) is re.Pattern:
|
||||||
pre, match, post = highlight.split(value, maxsplit=1)
|
pre, match, post = highlight.split(value, maxsplit=1)
|
||||||
else:
|
else:
|
||||||
|
highlight = re.escape(highlight)
|
||||||
pre, match, post = re.split(fr'({highlight})', value, maxsplit=1, flags=re.IGNORECASE)
|
pre, match, post = re.split(fr'({highlight})', value, maxsplit=1, flags=re.IGNORECASE)
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
# Match not found
|
# Match not found
|
||||||
|
Loading…
Reference in New Issue
Block a user