AttributeAlter: stop gracefully when no such attribute is found.

git-svn-id: http://simplesamlphp.googlecode.com/svn/trunk@3352 44740490-163a-0410-bde0-09ae8108e29a
This commit is contained in:
jaimepc@gmail.com 2014-02-03 14:11:01 +00:00
parent f5a9f3c081
commit d90d3061aa
1 changed files with 2 additions and 2 deletions

View File

@ -135,9 +135,9 @@ class sspmod_core_Auth_Process_AttributeAlter extends SimpleSAML_Auth_Processing
throw new SimpleSAML_Error_Exception("Cannot use '%remove' when 'target' is different than 'subject'.");
}
// ensure the subject exists
if (!array_key_exists($this->subject, $attributes)) {
throw new SimpleSAML_Error_Exception("Can't find " . $this->subject . " in user's attributes.");
// if no such subject, stop gracefully
return;
}
if ($this->replace) { // replace the whole value