#30635: Add feature to sanitize text include control characters
------------------------------------------+------------------------
Reporter: Tatsuya Matoba | Owner: nobody
Type: New feature | Status: new
Component: Utilities | Version: 2.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------+------------------------
Current, If Django send to feed text with control characters, Django raise
the `UnserializableContentError` .
It was added by #20197.
I think a common solution for app developers who encounter this problem
would be to sanitize the control characters.
I think it is desirable Django provide sanitizing feature for control
characters.
For example, add the following function to `django/utils/xmlutils.py` :
{{{
def sanitize_control_charcters(text):
return re.sub(r'[\x00-\x08\x0B-\x0C\x0E-\x1F]', " ", text)
}}}
If there is no problem with adding functions, I would like to send a PR.
--
Ticket URL: <https://code.djangoproject.com/ticket/30635>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/051.a138b2a3709ca3e919c9ba4a51004d35%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.