|
Server : Apache System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64 User : njnconst ( 1116) PHP Version : 8.4.18 Disable Function : NONE Directory : /lib64/python2.7/site-packages/django/contrib/comments/ |
Upload File : |
�
r�\c @ s d d l Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m
Z
d d l m Z m
Z
d d l m Z d d l m Z d d
l m Z d d l m Z m Z m Z e e d d
� Z d e j f d � � YZ d e f d � � YZ d e f d � � YZ d S( i����N( t forms( t ErrorDict( t settings( t ContentType( t Comment( t salted_hmact constant_time_compare( t
force_text( t
get_text_list( t timezone( t ungettextt ugettextt
ugettext_lazyt COMMENT_MAX_LENGTHi� t CommentSecurityFormc B s� e Z d Z e j d e j � Z e j d e j � Z e j d e j � Z e j d d d d d e j � Z
d d d � Z d � Z
d � Z d � Z d � Z d
� Z d � Z RS(
sI
Handles the security aspects (anti-spoofing) for comment forms.
t widgett
min_lengthi( t
max_lengthc C sT | | _ | d k r i } n | j | j � � t t | � j d | d | � d S( Nt datat initial( t
target_objectt Nonet updatet generate_security_datat superR t __init__( t selfR R R ( ( s? /tmp/pip-install-XxeQeY/django/django/contrib/comments/forms.pyR s
c C sJ t � } x: d d d g D]) } | | j k r | j | | | <q q W| S( s1 Return just those errors associated with securityt honeypott timestampt
security_hash( R t errors( R R t f( ( s? /tmp/pip-install-XxeQeY/django/django/contrib/comments/forms.pyt security_errors s
c C s� i | j j d d � d 6| j j d d � d 6| j j d d � d 6} | j | � } | j d } t | | � s� t j d � � n | S( s Check the security hash.t content_typet t object_pkR R s Security hash check failed.( R t gett generate_security_hasht cleaned_dataR R t ValidationError( R t security_hash_dictt
expected_hasht actual_hash( ( s? /tmp/pip-install-XxeQeY/django/django/contrib/comments/forms.pyt clean_security_hash'