mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 19:09:32 +00:00
8 lines
199 B
Python
8 lines
199 B
Python
""" Helper methods for various modules. """
|
|
|
|
import re
|
|
|
|
def sanitize_filename(filename):
|
|
""" Sanitizes a filename by removing .. / and \\. """
|
|
return re.sub(r"(~|(\.\.)|/|\+)", "", filename)
|