diff options
-rw-r--r-- | bugzilla.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bugzilla.rb b/bugzilla.rb index 5000e4a..a4d88f5 100644 --- a/bugzilla.rb +++ b/bugzilla.rb @@ -546,6 +546,7 @@ class BugzillaPlugin < Plugin # This function is used to check if an user requested bug # information inline in the text of a message rather than directly # to the bot. + MESSAGE_RE = /\bbug(?:[[:space:]]*)(?:#?([0-9]+|#[-[:alnum:]~`!@#$%^&*()_+={}\]\[\\\/|:;\'"<>.?]{3,40}))(?:(?:#c| comment #?)([0-9]+))?/i def listen(m) return if m.address? return unless lurk?(m) @@ -565,8 +566,7 @@ class BugzillaPlugin < Plugin # bug aliases can contain # 0-9, a-z, A-Z # and then every punctuation except "," - message_re = /\bbug(?:[[:space:]]*)(?:#?([0-9]+|#[-[:alnum:]~`!@#$%^&*()_+={}\]\[\\\/|:;\'"<>.?]{3,40}))(?:(?:#c| comment #?)([0-9]+))?/i - message.scan(message_re).each do |bug_comment| + m.scan(MESSAGE_RE).each do |bug_comment| bugno = bug_comment[0] comment = bug_comment[1] || "" bugno.gsub!(/^#/,'') |