Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix(commands): validate name encoding for non-Latin characters (#11965)

Benjamind9875fe23202
diff --git a/api/commands.py b/api/commands.py
index 09548ac9f33..bf013cc77e0 100644
--- a/api/commands.py
+++ b/api/commands.py
@@ -555,7 +555,8 @@ def create_tenant(email: str, language: Optional[str] = None, name: Optional[str
if language not in languages:
language = "en-US"
- name = name.strip()
+ # Validates name encoding for non-Latin characters.
+ name = name.strip().encode("utf-8").decode("utf-8") if name else None
# generate random password
new_password = secrets.token_urlsafe(16)