Skip to content

Commit

Permalink
Cap off substring, fixes #420
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Sep 15, 2013
1 parent 230d73a commit 657b622
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/net/aufdemrand/denizen/objects/Element.java
Expand Up @@ -555,6 +555,8 @@ else if (element.toLowerCase().contains(contains.toLowerCase()))
ending_index = Integer.valueOf(attribute.getContext(1).split(",")[1]) - 1;
else
ending_index = element.length();
if (beginning_index < 0) beginning_index = 0;
if (ending_index > element.length()) ending_index = element.length();
return new Element(element.substring(beginning_index, ending_index))
.getAttribute(attribute.fulfill(1));
}
Expand Down

0 comments on commit 657b622

Please sign in to comment.