mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-19 01:58:43 -06:00
Fixes #19265: Strip linebreaks from URLs for logging
This commit is contained in:
@@ -1,9 +1,17 @@
|
||||
__all__ = (
|
||||
'remove_linebreaks',
|
||||
'title',
|
||||
'trailing_slash',
|
||||
)
|
||||
|
||||
|
||||
def remove_linebreaks(value):
|
||||
"""
|
||||
Remove all line breaks from a string and return the result. Useful for log sanitization purposes.
|
||||
"""
|
||||
return value.replace('\n', '').replace('\r', '')
|
||||
|
||||
|
||||
def title(value):
|
||||
"""
|
||||
Improved implementation of str.title(); retains all existing uppercase letters.
|
||||
|
||||
Reference in New Issue
Block a user