Skip to content

Commit

Permalink
Merge pull request tgstation#17682 from optimumtact/patch-1
Browse files Browse the repository at this point in the history
Improve chatter regex to prevent infinite loop
  • Loading branch information
Jordie0608 committed May 15, 2016
2 parents edad888 + 4a365ae commit c6cad13
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions code/modules/chatter/chatter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
var/list/punctuation = list(",",":",";",".","?","!","\'","-")
var/regex/R = regex("(\[\\l\\d]*)(\[^\\l\\d\\s])?", "g")
var/list/letter_count = list()
while(R.next <= length(message))
R.Find(message)
while(R.Find(message) != 0)
if(R.group[1])
letter_count += length(R.group[1])
if(R.group[2])
Expand Down

0 comments on commit c6cad13

Please sign in to comment.