Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -146,6 +146,8 @@ def generate_session_token() -> str:
|
|
146 |
|
147 |
def sanitize_input(text: str) -> str:
|
148 |
"""Sanitize user input to prevent XSS and injection attacks."""
|
|
|
|
|
149 |
return bleach.clean(text.strip(), tags=[], attributes={}, protocols=[], strip=True)
|
150 |
|
151 |
def validate_name(name: str) -> str:
|
|
|
146 |
|
147 |
def sanitize_input(text: str) -> str:
|
148 |
"""Sanitize user input to prevent XSS and injection attacks."""
|
149 |
+
if not text:
|
150 |
+
return ""
|
151 |
return bleach.clean(text.strip(), tags=[], attributes={}, protocols=[], strip=True)
|
152 |
|
153 |
def validate_name(name: str) -> str:
|