Arch Capital is reviewing user-supplied text before it reaches a security filter. Write a function that detects whether an input string contains likely SQL injection patterns.
Given a string text, return True if it contains a suspicious SQL injection pattern, otherwise return False.
A string is considered suspicious if, after lowercasing it, it contains any of the following:
--, /*, or */;or 1=1 or or '1'='1'union select, drop table, or insert intoTreat repeated spaces, tabs, and newlines as whitespace. Matching should be case-insensitive.
def detect_sql_injection(text):