about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorGeorg Lukas <georg@op-co.de>2017-02-13 17:59:01 +0100
committerGeorg Lukas <georg@op-co.de>2017-02-13 17:59:01 +0100
commitc48323994c33c4398b4ae92744bff1d9246a0344 (patch)
tree9b4a3109ce46ab8b9e1cc5eefb3e5dbdb206e44a /scripts
parentb969375ec73dbc5935e2cc5fff0cef4df8e8c296 (diff)
downloadphp-xmpp-invitation-c48323994c33c4398b4ae92744bff1d9246a0344.tar.gz
Properly URL-encode the JID, needed for IRC transports
Diffstat (limited to 'scripts')
-rw-r--r--scripts/main.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/main.js b/scripts/main.js
index d0e996e..5c4e9c4 100644
--- a/scripts/main.js
+++ b/scripts/main.js
@@ -48,6 +48,10 @@
 			key_prefix = "muc.";
 		}
 
+		var jid_parts = display_data.jid.split("?");
+		jid_parts[0] = encodeURIComponent(jid_parts[0]) // URL-encode the JID only
+		display_data.jid = jid_parts.join("?");
+
 		// TODO: proper error checking / display / Creation of invitations
 		if (jid.search("@") <= 0) return {jid:"", name: "Somebody"};