summaryrefslogtreecommitdiff
path: root/django/utils/text.py
Commit message (Collapse)AuthorAgeFilesLines
* Fixed #34170 -- Implemented Heal The Breach (HTB) in GzipMiddleware.Andreas Pelme2022-12-171-4/+24
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-071-53/+95
|
* Refs #27753 -- Removed unused django.utils.text._replace_entity() and ↵Mariusz Felisiak2021-12-301-23/+0
| | | | | _entity_re. Unused since 157ab32f3446da7fa1f9d716509c290069a2a156.
* Fixed unescape_string_literal() crash on empty strings.Florian Apolloner2021-12-141-1/+1
|
* Fixed #32859 -- Simplified compress_string() by using gzip.compress().Illia Volochii2021-06-211-7/+2
|
* Fixed CVE-2021-31542 -- Tightened path & file name sanitation in file uploads.Florian Apolloner2021-05-041-3/+7
|
* Optimized django.utils.text.capfirst().Nick Pope2021-03-231-1/+5
| | | Unconditionally coercing to str type twice is expensive.
* Refs #27753 -- Removed django.utils.text.unescape_entities() per deprecation ↵Mariusz Felisiak2021-01-141-12/+0
| | | | timeline.
* Fixed #28694 -- Made django.utils.text.slugify() strip dashes and underscores.David Smith2020-05-291-3/+3
|
* Corrected slugify()'s docstring.David Smith2020-05-291-3/+4
|
* Refs #30116 -- Simplified regex match group access with Match.__getitem__().Jon Dufresne2020-05-111-6/+6
| | | | | The method has been available since Python 3.6. The shorter syntax is also marginally faster.
* Fixed #30892 -- Fixed slugify() and admin's URLify.js for "İ".Sjbrgsn2019-12-301-1/+1
| | | | | | Thanks Luis Nell for the implementation idea and very detailed report. Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
* Fixed #30899 -- Lazily compiled import time regular expressions.Hasan Ramezani2019-10-291-7/+8
|
* Removed unneeded ValueError catching in django.utils.text._replace_entity().Jon Dufresne2019-08-011-1/+1
| | | | | The html.entities.name2codepoint dict contains only valid Unicode codepoints. Either the key exists and chr() will succeed or the key does not exist.
* Fixed CVE-2019-14232 -- Adjusted regex to avoid backtracking issues when ↵Florian Apolloner2019-08-011-2/+2
| | | | | | truncating HTML. Thanks to Guido Vranken for initial report.
* Refs #27753 -- Deprecated django.utils.text.unescape_entities().Jon Dufresne2019-05-081-0/+7
| | | | | | | The function was undocumented and only required for compatibility with Python 2. Code should use Python's html.unescape() that was added in Python 3.4.
* Simplified utils.text.StreamingBuffer.Sergey Fedoseev2018-10-041-17/+4
|
* Normalized spelling of "lowercase" and "lowercased".Jon Dufresne2018-09-251-1/+1
|
* Fixed #29654 -- Made text truncation an ellipsis character instead of three ↵Claude Paroz2018-08-211-4/+3
| | | | | | dots. Thanks Sudhanshu Mishra for the initial patch and Tim Graham for the review.
* Fixed #29412 -- Stopped marking slugify() result as HTML safe.Claude Paroz2018-07-201-6/+3
|
* Fixed CVE-2018-7537 -- Fixed catastrophic backtracking in ↵Tim Graham2018-03-061-1/+1
| | | | | | django.utils.text.Truncator. Thanks James Davis for suggesting the fix.
* Fixed #28860 -- Removed unnecessary len() calls.Дилян Палаузов2017-12-041-1/+1
|
* Refs #27795 -- Replaced many force_text() with str()Claude Paroz2017-04-271-13/+10
| | | | Thanks Tim Graham for the review.
* Removed duplicate lines in slugify().Jon Dufresne2017-04-101-3/+2
|
* Refs #27795 -- Removed unneeded force_text callsClaude Paroz2017-03-041-3/+0
| | | | Thanks Tim Graham for the review.
* Refs #27656 -- Updated django.utils docstring verbs according to PEP 257.Anton Samarchyan2017-02-111-25/+22
|
* Converted usage of ugettext* functions to their gettext* aliasesClaude Paroz2017-02-071-2/+2
| | | | Thanks Tim Graham for the review.
* Refs #23919, #27778 -- Removed obsolete mentions of unicode.Vytis Banaitis2017-01-261-1/+1
|
* Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand2017-01-251-1/+1
|
* Refs #23919 -- Removed re.U and re.UNICODE (default on Python 3).Mariusz Felisiak2017-01-211-4/+4
|
* Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette2017-01-191-1/+1
|
* Refs #23919 -- Removed most of remaining six usageClaude Paroz2017-01-181-4/+3
| | | | Thanks Tim Graham for the review.
* Refs #23919 -- Removed six.<various>_types usageClaude Paroz2017-01-181-2/+2
| | | | Thanks Tim Graham and Simon Charette for the reviews.
* Refs #23919 -- Removed six.PY2/PY3 usageClaude Paroz2017-01-181-5/+0
| | | | Thanks Tim Graham for the review.
* Refs #23919 -- Removed encoding preambles and future importsClaude Paroz2017-01-181-2/+0
|
* Fixed E305 flake8 warnings.Ramin Farajpour Cami2016-11-141-0/+3
|
* Decorated a few functions.Tim Graham2016-11-141-2/+3
|
* Refs #19705 -- Changed gzip modification times to 0.Kevin Christopher Henry2016-10-141-2/+2
| | | | | This makes gzip output deterministic, which allows ConditionalGetMiddleware to reliably compare ETags on gzipped content (views using the gzip_page() decorator in particular).
* Refs #27025 -- Fixed "invalid escape sequence" warnings in Python 3.6.Tim Graham2016-09-171-4/+4
| | | | http://bugs.python.org/issue27364
* Fixed #26866 -- Added format_lazy functionMattias Loverot2016-08-241-1/+12
| | | | | Added format_lazy function to django.utils.text module. Useful when dealing with relative complex lazy string concatenations (e.g. in urls.py when translating urls in regular expressions).
* Fixed #27020 -- Used a context manager to close files.Ville Skyttä2016-08-041-12/+10
|
* Fixed E128 flake8 warnings in django/.Tim Graham2016-04-081-4/+6
|
* Fixed #26125 -- Fixed E731 flake warnings.userimack2016-01-251-1/+2
|
* Fixed #20223 -- Added keep_lazy() as a replacement for allow_lazy().Iacopo Spalletti2015-12-121-13/+13
| | | | Thanks to bmispelon and uruz for the initial patch.
* Fixed #16501 -- Added an allow_unicode parameter to SlugField.Edward Henderson2015-07-171-4/+8
| | | | Thanks Flavio Curella and Berker Peksag for the initial patch.
* Sorted imports with isort; refs #23860.Tim Graham2015-02-061-4/+4
|
* Fixed #24242 -- Improved efficiency of utils.text.compress_sequence()Matthew Somerville2015-02-041-2/+5
| | | | | | | | | The function no longer flushes zfile after each write as doing so can lead to the gzipped streamed content being larger than the original content; each flush adds a 5/6 byte type 0 block. Removing this means buf.read() may return nothing, so only yield if that has some data. Testing shows without the flush() the buffer is being flushed every 17k or so and compresses the same as if it had been done as a whole string.
* Removed utils.text.javascript_quote() per deprecation timeline; refs #21725.Tim Graham2015-01-171-29/+0
|
* Fixed #23558 -- documented slugify limitationsDavid Hoffman2014-10-301-3/+3
|
* Fixed #20221 -- Allowed some functions that use mark_safe() to result in ↵Jon Dufresne2014-10-201-2/+3
| | | | | | SafeText. Thanks Baptiste Mispelon for the report.