Bring parse regex inline with RFC for user part of the prefix
authorJack Allnutt <m2ys4u@gmail.com>
Mon, 3 Jun 2013 12:32:51 +0000 (13:32 +0100)
committerJack Allnutt <m2ys4u@gmail.com>
Mon, 3 Jun 2013 12:32:51 +0000 (13:32 +0100)
Fixes #283

server/irc/connection.js

index 9e9ab3b881de38c59d6531c190cb4d0c589769da..88d77581e06f1a48a88ac23c37d20749aca1e365 100644 (file)
@@ -407,7 +407,7 @@ function findWebIrc(connect_data) {
  * Deviates from the RFC a little to support the '/' character now used in some
  * IRCds
  */
-var parse_regex = /^(?:(?:(?:(@[^ ]+) )?):(?:([a-z0-9\x5B-\x60\x7B-\x7D\.\-*]+)|([a-z0-9\x5B-\x60\x7B-\x7D\.\-*]+)!([a-z0-9~\.\-_|]+)@?([a-z0-9\.\-:\/_]+)?) )?(\S+)(?: (?!:)(.+?))?(?: :(.+))?$/i;
+var parse_regex = /^(?:(?:(?:(@[^ ]+) )?):(?:([a-z0-9\x5B-\x60\x7B-\x7D\.\-*]+)|([a-z0-9\x5B-\x60\x7B-\x7D\.\-*]+)!([^\x00\r\n\ ]+?)@?([a-z0-9\.\-:\/_]+)?) )?(\S+)(?: (?!:)(.+?))?(?: :(.+))?$/i;
 
 var parse = function (data) {
     var i,