changeset 1572:7006b55001a4

broweser (jid): add a simple check for JID validation.
author Goffi <goffi@goffi.org>
date Wed, 22 Nov 2023 16:31:36 +0100
parents ff633e19a069
children 02432346e9b2
files libervia/web/pages/_browser/jid.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libervia/web/pages/_browser/jid.py	Wed Nov 22 16:31:36 2023 +0100
+++ b/libervia/web/pages/_browser/jid.py	Wed Nov 22 16:31:36 2023 +0100
@@ -89,7 +89,12 @@
         @return: True if the JID is XMPP compliant
         """
         # Simple check for domain part
-        if not self.domain or self.domain.startswith(".") or self.domain.endswith("."):
+        if (
+            not self.domain
+            or self.domain.startswith(".")
+            or self.domain.endswith(".")
+            or "." not in self.domain
+        ):
             return False
         if ".." in self.domain:
             return False