← Back
Editing: utils.cpython-311.pyc
� 48zj+ � �D � d dl Z d dlZd dlmZ dd�Z G d� d� � ZdS )� N)�SuspiciousFileOperationFc � � t j � | � � dv rt d| z � � �|ret j t | � � � dd� � � � }|� � � s d|j v rt d| z � � �n5| t j � | � � k rt d| z � � �| S )N> � �.�..z$Could not derive file name from '%s'�\�/r z'Detected path traversal attempt in '%s'z%File name '%s' includes path elements) �os�path�basenamer �pathlib� PurePosixPath�str�replace�is_absolute�parts)�name�allow_relative_pathr s �9/usr/lib/python3/dist-packages/django/core/files/utils.py�validate_file_namer s� � � �w�������0�0�%�&L�t�&S�T�T�T�� V� �$�S��Y�Y�%6�%6�t�S�%A�%A�B�B������� ����!3�!3�)�9�D�@�� � � "4� ���!�!�$�'�'� '� '�%�&M�PT�&T�U�U�U��K� c � � e Zd ZdZ ed� � � Z ed� � � Z ed� � � Z ed� � � Z ed� � � Z ed� � � Z ed� � � Z ed � � � Z ed � � � Z ed� � � Z ed� � � Z ed � � � Z ed� � � Z ed� � � Zed� � � Zd� Zd� Zd� Zd� ZdS )�FileProxyMixinz� A mixin class used to forward file methods to an underlaying file object. The internal file object has to be called "file":: class FileProxy(FileProxyMixin): def __init__(self, file): self.file = file c � � | j j S �N)�file�encoding��selfs r �<lambda>zFileProxyMixin.<lambda>$ � � �T�Y�%7� r c � � | j j S r )r �filenor s r r zFileProxyMixin.<lambda>% � � �4�9�#3� r c � � | j j S r )r �flushr s r r zFileProxyMixin.<lambda>&