#!/usr/bin/env python

"""
Copyright (c) 2006-2024 sqlmap developers (https://sqlmap.org/)
See the file 'LICENSE' for copying permission
"""

from lib.core.enums import PRIORITY

# 设置优先级为最高
__priority__ = PRIORITY.HIGHEST

# 定义依赖函数
def dependencies():
    pass

# 定义tamper函数，用于替换payload中的UNION ALL SELECT为UNION SELECT
def tamper(payload, **kwargs):
    """
    Replaces instances of UNION ALL SELECT with UNION SELECT counterpart

    >>> tamper('-1 UNION ALL SELECT')
    '-1 UNION SELECT'
    """

    # 如果payload存在，则替换其中的UNION ALL SELECT为UNION SELECT
    return payload.replace("UNION ALL SELECT", "UNION SELECT") if payload else payload
