Improved followup regex (quote ticket_hook).
This commit is contained in:
parent
199bf8773a
commit
aa6ba57cde
2 changed files with 4 additions and 4 deletions
|
@ -82,12 +82,12 @@ module Ticket::Number::Date
|
||||||
ticket = nil
|
ticket = nil
|
||||||
|
|
||||||
# probe format
|
# probe format
|
||||||
string.scan(/#{ticket_hook}#{ticket_hook_divider}(#{system_id}\d{2,48})/i) {
|
string.scan(/#{Regexp.quote(ticket_hook)}#{Regexp.quote(ticket_hook_divider)}(#{system_id}\d{2,48})/i) {
|
||||||
ticket = Ticket.find_by(number: $1)
|
ticket = Ticket.find_by(number: $1)
|
||||||
break if ticket
|
break if ticket
|
||||||
}
|
}
|
||||||
if !ticket
|
if !ticket
|
||||||
string.scan(/#{ticket_hook}\s{0,2}(#{system_id}\d{2,48})/i) {
|
string.scan(/#{Regexp.quote(ticket_hook)}\s{0,2}(#{system_id}\d{2,48})/i) {
|
||||||
ticket = Ticket.find_by(number: $1)
|
ticket = Ticket.find_by(number: $1)
|
||||||
break if ticket
|
break if ticket
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,12 +79,12 @@ module Ticket::Number::Increment
|
||||||
ticket = nil
|
ticket = nil
|
||||||
|
|
||||||
# probe format
|
# probe format
|
||||||
string.scan(/#{ticket_hook}#{ticket_hook_divider}(#{system_id}\d{2,48})/i) {
|
string.scan(/#{Regexp.quote(ticket_hook)}#{Regexp.quote(ticket_hook_divider)}(#{system_id}\d{2,48})/i) {
|
||||||
ticket = Ticket.find_by(number: $1)
|
ticket = Ticket.find_by(number: $1)
|
||||||
break if ticket
|
break if ticket
|
||||||
}
|
}
|
||||||
if !ticket
|
if !ticket
|
||||||
string.scan(/#{ticket_hook}\s{0,2}(#{system_id}\d{2,48})/i) {
|
string.scan(/#{Regexp.quote(ticket_hook)}\s{0,2}(#{system_id}\d{2,48})/i) {
|
||||||
ticket = Ticket.find_by(number: $1)
|
ticket = Ticket.find_by(number: $1)
|
||||||
break if ticket
|
break if ticket
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue