Posted by BenK on November 28, 2009 at 11:27pm
3 followers
Jump to:
| Project: | Instant messenger |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
I just wanted to report one small bug that I recently noticed: If you try to type an "&" in a chat message, the "&" and all of the text after it won't display.
This issue surfaced in our chatroom because we use the phrase "Q&A" quite a bit. (Our chatroom sessions are actually called "Q&A Sessions" on our site.) Every time we typed Q&A, the displayed message ended on the Q.
Most likely, the & symbol needs to be escaped somewhere in the code.
Cheers,
Ben
Comments
#1
I have this same problem. The whole message shows up for the user that typed it, but not the other user. Other special characters work though.
#2
this patch solves the problem:
--- sites/all/modules/im/im.js.orig 2010-08-27 17:56:39.000000000 +0200+++ sites/all/modules/im/im.js 2010-08-27 17:59:47.000000000 +0200
@@ -85,7 +85,7 @@
var sendurl= url_prefix + 'im/send_msg/'
+ $('#edit-im-my-uid').val() + '/'
+ $('#edit-im-other-uid').val() + '/?msg='
- + encodeURI(sendText);
+ + encodeURIComponent(sendText);
$.ajax({
type: 'GET',
url: sendurl,
anyway, just replace "encodeURI" with "encodeURIComponent" in im.js, this will escape ALL chars (encodeURI skips , / ? : @ & = + $ #).