Skip to content
Snippets Groups Projects
Commit 6000f854 authored by Douwe Maan's avatar Douwe Maan
Browse files

Validate bounds just to be sure

parent 0e992a3b
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -93,6 +93,9 @@ module Gitlab
 
# Inserts tags around the characters identified by the given range
def insert_around_range(text, range, before, after, offset = 0)
# Just to be sure
return offset if offset + range.end + 1 > text.length
text.insert(offset + range.begin, before)
offset += before.length
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment