diff options
author | BlueRaja <BlueRaja.admin@gmail.com> | 2013-06-08 15:05:14 -0500 |
---|---|---|
committer | BlueRaja <BlueRaja.admin@gmail.com> | 2013-06-08 15:05:14 -0500 |
commit | f4d221abc57c35a66e8e2c616f1029f86dec1f8e (patch) | |
tree | 30da50b95cbff72b5129b6ea5ab8141922831076 | |
parent | f04b70c9c12daf0e91c591a732566ab8e5b4752c (diff) | |
download | pathery-f4d221abc57c35a66e8e2c616f1029f86dec1f8e.tar.xz |
question marks now work in chat
-rw-r--r-- | pages/chat.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pages/chat.php b/pages/chat.php index 4a14a8d..a285d7d 100644 --- a/pages/chat.php +++ b/pages/chat.php @@ -179,9 +179,10 @@ function chatReplaceAndEncode(chat) { var URLexp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
chat = chat.replace(URLexp, "<a href='redirect?to=$1' target='_blank' onclick='return doNothingWhenClickingLinks();'>$1</a>");
- //Replace # in the URL with %23
+ //Replace # with %23, & with %26, ? with %3F
chat = chat.replace(/<a href='redirect\?to=(.*?)(#)(.*?)' target='_blank'/ig, "<a href='redirect?to=$1%23$3' target='_blank'");
chat = chat.replace(/<a href='redirect\?to=(.*?)(&)(.*?)' target='_blank'/ig, "<a href='redirect?to=$1%26$3' target='_blank'");
+ chat = chat.replace(/<a href='redirect\?to=(.*?)(\?)(.*?)' target='_blank'/ig, "<a href='redirect?to=$1%3F$3' target='_blank'");
//Making the bet that not all browsers do the same:
chat = chat.replace(/<a href='redirect\?to=(.*?)(&)(.*?)' target='_blank'/ig, "<a href='redirect?to=$1%26$3' target='_blank'");
|