summaryrefslogtreecommitdiff
path: root/django/core/validators.py
Commit message (Collapse)AuthorAgeFilesLines
* Fixed #34233 -- Dropped support for Python 3.8 and 3.9.Mariusz Felisiak2023-01-181-10/+0
|
* Fixed #34014 -- Fixed DecimalValidator validating 0 in positive exponent ↵Kamil Turek2022-09-171-2/+4
| | | | | | scientific notation. Thanks Shiplu Mokaddim for the report.
* Fixed #32559 -- Added 'step_size’ to numeric form fields.Kapil Bansal2022-05-121-0/+10
| | | | Co-authored-by: Jacob Rief <jacob.rief@uibk.ac.at>
* Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak2022-02-071-9/+19
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-071-164/+210
|
* Fixed #28628 -- Changed \d to [0-9] in regexes where appropriate.Ad Timmering2022-01-071-3/+6
|
* Fixed #33367 -- Fixed URLValidator crash in some edge cases.mendespedro2021-12-201-6/+7
|
* Refs #31670 -- Removed whitelist argument and domain_whitelist attribute in ↵Mariusz Felisiak2021-09-201-30/+1
| | | | EmailValidator per deprecation timeline.
* Fixed typo in regex for IPv6 literals in EmailValidator.qimingmafan2021-08-061-1/+1
|
* Fixed #32930 -- Fixed URLValidator when port numbers < 10.Wu Haotian2021-07-221-2/+2
|
* Fixed CVE-2021-33571 -- Prevented leading zeros in IPv4 addresses.Mariusz Felisiak2021-06-021-1/+14
| | | | | | | | validate_ipv4_address() was affected only on Python < 3.9.5, see [1]. URLValidator() uses a regular expressions and it was affected on all Python versions. [1] https://bugs.python.org/issue36384
* Fixed #32713, Fixed CVE-2021-32052 -- Prevented newlines and tabs from being ↵Mariusz Felisiak2021-05-061-0/+3
| | | | | | | | | | | | | | accepted in URLValidator on Python 3.9.5+. In Python 3.9.5+ urllib.parse() automatically removes ASCII newlines and tabs from URLs [1, 2]. Unfortunately it created an issue in the URLValidator. URLValidator uses urllib.urlsplit() and urllib.urlunsplit() for creating a URL variant with Punycode which no longer contains newlines and tabs in Python 3.9.5+. As a consequence, the regular expression matched the URL (without unsafe characters) and the source value (with unsafe characters) was considered valid. [1] https://bugs.python.org/issue43882 and [2] https://github.com/python/cpython/commit/76cd81d60310d65d01f9d7b48a8985d8ab89c8b4
* Fixed #32298 -- Fixed URLValidator hostname length validation.Akshat1Nar2021-01-041-1/+1
| | | | | URLValidator now validates the maximum length of a hostname without the userinfo and port.
* Fixed #31806 -- Made validators include the value in ValidationErrors.Jon Dufresne2020-07-271-18/+19
|
* Removed redundant forms.DecimalField.validate() in favor of DecimalValidator.Jon Dufresne2020-07-271-1/+1
|
* Refs #31670 -- Renamed whitelist argument and attribute of EmailValidator.David Smith2020-06-181-6/+35
|
* Refs #30116 -- Simplified regex match group access with Match.__getitem__().Jon Dufresne2020-05-111-2/+2
| | | | | The method has been available since Python 3.6. The shorter syntax is also marginally faster.
* Fixed #31548 -- Fixed URLValidator crash on non-strings.Yash Saini2020-05-081-1/+3
|
* Capitalized Unicode in docs, strings, and comments.Jon Dufresne2020-04-201-1/+1
|
* Fixed #31311 -- Removed unneeded escapes in validator regexes.kimbo2020-02-281-3/+3
| | | | | | | Special characters lose their special meaning inside sets of characters. "-" lose its special meaning if it's placed as the first or last character.
* Refs #30899 -- Moved _lazy_re_compile() to the django.utils.regex_helper.Hasan Ramezani2019-10-291-13/+1
|
* Fixed #30651 -- Made __eq__() methods return NotImplemented for not ↵ElizabethU2019-10-011-1/+2
| | | | | | | | | implemented comparisons. Changed __eq__ to return NotImplemented instead of False if compared to an object of the same type, as is recommended by the Python data model reference. Now these models can be compared to ANY (or other objects with __eq__ overwritten) without returning False automatically.
* Refs #30608 -- Added django.utils.encoding.punycode().Mariusz Felisiak2019-07-031-2/+3
|
* Fixed #30400 -- Improved typography of user facing strings.Jon Dufresne2019-06-281-4/+4
| | | | Thanks Claude Paroz for assistance with translations.
* Fixed #29860 -- Allowed BaseValidator to accept a callable limit_value.buzzi2018-10-221-2/+3
|
* Fixed #29528 -- Made URLValidator reject invalid characters in the username ↵Tim Bell2018-07-231-1/+1
| | | | and password.
* Ref #23919 -- Replaced some os.path usage with pathlib.Path.Tom2018-04-191-2/+2
|
* Fixed #29065 -- Made django.core.validators only load Pillow if needed.Collin Anderson2018-01-301-3/+2
|
* Fixed #29007 -- Fixed DecimalValidator crash on NaN, SNan, Inf, and Infinity ↵Fabio Bonelli2018-01-101-0/+3
| | | | values.
* Fixed #28906 -- Removed unnecessary bool() calls.Tim Graham2017-12-071-1/+1
|
* Fixed #28562 -- Fixed DecimalValidator handling of positive exponent ↵Josh Schneier2017-09-271-9/+15
| | | | scientific notation.
* Reverted "Fixed #27818 -- Replaced try/except/pass with contextlib.suppress()."Tim Graham2017-09-071-2/+3
| | | | This reverts commit 550cb3a365dee4edfdd1563224d5304de2a57fda because try/except performs better.
* Fixed #28201 -- Added ProhibitNullCharactersValidator and used it on ↵Alejandro Zamora2017-08-121-0/+24
| | | | CharField form field.
* Fixed #27818 -- Replaced try/except/pass with contextlib.suppress().Mads Jensen2017-06-281-5/+5
|
* Fixed #28165 -- Ignored case in FileExtensionValidator's allowed_extensions.Arne de Laat2017-06-071-0/+2
|
* Fixed #28249 -- Removed unnecessary dict.keys() calls.Jon Dufresne2017-05-271-1/+1
| | | iter(dict) is equivalent to iter(dict.keys()).
* Made RegexValidator's inverse_match logic clearer.Edward D'Souza2017-05-251-3/+5
|
* Refs #27795 -- Replaced many force_text() with str()Claude Paroz2017-04-271-3/+1
| | | | Thanks Tim Graham for the review.
* Fixed #27952 -- Added translation hint for RegexValidator error message.Paul2017-03-231-0/+1
|
* Fixed #27945 -- Clarified that RegexValidator searches with the regex.seanfagan2017-03-211-1/+1
|
* Refs #27795 -- Removed unneeded force_text callsClaude Paroz2017-03-041-3/+0
| | | | Thanks Tim Graham for the review.
* Refs #27656 -- Updated django.core docstring verbs according to PEP 257.Anton Samarchyan2017-02-211-5/+3
|
* Converted usage of ugettext* functions to their gettext* aliasesClaude Paroz2017-02-071-6/+6
| | | | Thanks Tim Graham for the review.
* Fixed #27793 -- Used stdlib's ipaddress module to validate IP addressesClaude Paroz2017-01-301-2/+7
| | | | 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-3/+3
|
* Removed unused variables that are overwritten.Mads Jensen2017-01-251-1/+0
|
* Refs #23919 -- Removed re.U and re.UNICODE (default on Python 3).Mariusz Felisiak2017-01-211-1/+1
|
* Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette2017-01-191-5/+5
|
* Refs #23919 -- Removed obsolete __ne__() methods.Aymeric Augustin2017-01-181-3/+0
| | | | | __ne__() defaults to the opposite of __eq__() on Python 3 when it doesn't return NotImplemented.