diff options
| author | Georg Lukas <georg@op-co.de> | 2017-03-29 08:46:25 +0200 |
|---|---|---|
| committer | Georg Lukas <georg@op-co.de> | 2017-03-29 08:52:32 +0200 |
| commit | 518788dedf4f06dae6faaac29c17fac26ea24f79 (patch) | |
| tree | 888cc4ffad101fcd5061c7c344c524747fc654ae | |
| parent | c48323994c33c4398b4ae92744bff1d9246a0344 (diff) | |
| download | php-xmpp-invitation-518788dedf4f06dae6faaac29c17fac26ea24f79.tar.gz | |
URL-encoding: globals are evil, order matters
| -rw-r--r-- | scripts/main.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/main.js b/scripts/main.js index 5c4e9c4..8a79b4f 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -48,15 +48,16 @@ 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"}; var name = jid.split("@")[0]; name = name.charAt(0).toUpperCase() + name.slice(1); + + var jid_parts = jid.split("?"); + jid_parts[0] = encodeURIComponent(jid_parts[0]) // URL-encode the JID only + jid = jid_parts.join("?"); + return {jid: jid, name: name}; } |
