Fixed attribute-based functors.
[shibboleth/sp.git] / shibsp / attribute / filtering / impl / AttributeValueRegexFunctor.cpp
index b4a899e..5fc4fa0 100644 (file)
@@ -57,10 +57,10 @@ namespace shibsp {
             try {
                 m_regex = new RegularExpression(r, e->getAttributeNS(NULL,options));
             }
-            catch (XMLException& ex) {\r
-                xmltooling::auto_ptr_char temp(ex.getMessage());\r
-                throw ConfigurationException(temp.get());\r
-            }\r
+            catch (XMLException& ex) {
+                xmltooling::auto_ptr_char temp(ex.getMessage());
+                throw ConfigurationException(temp.get());
+            }
         }
 
         bool evaluatePolicyRequirement(const FilteringContext& filterContext) const {
@@ -70,9 +70,9 @@ namespace shibsp {
         }
 
         bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const {
-            if (!XMLString::equals(m_attributeID.get(), attribute.getId()))
-                return hasValue(filterContext);
-            return matches(attribute, index);
+            if (!m_attributeID.get() || !*m_attributeID.get() || XMLString::equals(m_attributeID.get(), attribute.getId()))
+                return matches(attribute, index);
+            return hasValue(filterContext);
         }
     };