Skip to content

Commit

Permalink
Correct rare bracketting issue
Browse files Browse the repository at this point in the history
Brackets are only valid if the text ends with a bracket
  • Loading branch information
mcmonkey4eva committed Sep 22, 2014
1 parent 311bb2a commit 0776cfa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -135,7 +135,7 @@ private String StripContext(String input) {
if (input == null)
return null;
int index = input.indexOf('[');
if (index < 0)
if (index < 0 || !input.endsWith("]"))
return input;
else
return input.substring(0, index);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/aufdemrand/denizen/tags/Attribute.java
Expand Up @@ -93,7 +93,7 @@ public Attribute(String attributes, ScriptEntry scriptEntry) {
public boolean matches(String string) {
if (attributes.isEmpty()) return false;
String attr = attributes.get(0);
if (attr.contains("["))
if (attr.contains("[") && attr.endsWith("]"))
attr = attr.substring(0, attr.indexOf('['));
return attr.equalsIgnoreCase(string);
}
Expand Down

0 comments on commit 0776cfa

Please sign in to comment.