From f9d0ee209bfb4d81bcc2b1c42d6b9c843cca038a Mon Sep 17 00:00:00 2001
From: Luke Taylor
+ *
* By default the class treats presented patterns as regular expressions. If
* the keyword PATTERN_TYPE_APACHE_ANT is present (case
* sensitive), patterns will be treated as Apache Ant paths rather than
@@ -117,11 +117,14 @@ public class FilterInvocationDefinitionSourceEditor
}
// Tokenize the line into its name/value tokens
- String[] nameValue = StringUtils.delimitedListToStringArray(line,
- "=");
+ String[] nameValue = StringUtils.delimitedListToStringArray(line, "=");
String name = nameValue[0];
String value = nameValue[1];
+ if(!StringUtils.hasLength(name) || !StringUtils.hasLength(value)) {
+ throw new IllegalArgumentException("Failed to parse a valid name/value pair from " + line);
+ }
+
// Convert value to series of security configuration attributes
ConfigAttributeEditor configAttribEd = new ConfigAttributeEditor();
configAttribEd.setAsText(value);
diff --git a/core/src/main/java/org/acegisecurity/intercept/web/PathBasedFilterInvocationDefinitionMap.java b/core/src/main/java/org/acegisecurity/intercept/web/PathBasedFilterInvocationDefinitionMap.java
index 07ef2ee908..2c7ce939da 100644
--- a/core/src/main/java/org/acegisecurity/intercept/web/PathBasedFilterInvocationDefinitionMap.java
+++ b/core/src/main/java/org/acegisecurity/intercept/web/PathBasedFilterInvocationDefinitionMap.java
@@ -31,10 +31,10 @@ import java.util.Vector;
/**
- * Maintains a List of ConfigAttributeDefinitions
+ * Maintains a List of ConfigAttributeDefinitions
* associated with different HTTP request URL Apache Ant path-based patterns.
*
- *
+ *
* Apache Ant path expressions are used to match a HTTP request URL against a
* ConfigAttributeDefinition.
*
+ *
* If no registered paths match the HTTP URL, null is returned.
*