mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-06 17:15:38 -08:00
integer causing normalization issue in MQTT #1102
This commit is contained in:
@@ -495,6 +495,8 @@ def sanitize_SQL_input(val):
|
|||||||
# Function to normalize the string and remove diacritics
|
# Function to normalize the string and remove diacritics
|
||||||
def normalize_string(text):
|
def normalize_string(text):
|
||||||
# Normalize the text to 'NFD' to separate base characters and diacritics
|
# Normalize the text to 'NFD' to separate base characters and diacritics
|
||||||
|
if not isinstance(text, str):
|
||||||
|
text = str(text)
|
||||||
normalized_text = unicodedata.normalize('NFD', text)
|
normalized_text = unicodedata.normalize('NFD', text)
|
||||||
# Filter out diacritics and unwanted characters
|
# Filter out diacritics and unwanted characters
|
||||||
return ''.join(c for c in normalized_text if unicodedata.category(c) != 'Mn')
|
return ''.join(c for c in normalized_text if unicodedata.category(c) != 'Mn')
|
||||||
|
|||||||
Reference in New Issue
Block a user