In sfBasicSecurityUser we have:
public function removeCredential($credential)
{
if ($this->hasCredential($credential))
{
for ($i = 0, $z = count($this->credentials); $i < $z; $i++)
{
if ($credential == $this->credentials[$i])
{
if (sfConfig::get('sf_logging_active')) $this->getContext()->getLogger()->info('{sfUser} remove credential "'.$credential.'"');
unset($this->credentials[$i]);
return;
}
}
}
}
Now imagine you set cred1, then you set cred2, then you unset cred1:
The array will have indice 0 for cred1, then indice 1 for cred2 then you remove indice 0, now if you try to remove another credential it will iterate on credentials[0] only as there is only one credential, but this indice will issue a notice about unexistent indice.
Maybe a foreach would be sufficient to correct this, like:
public function removeCredential($credential)
{
if ($this->hasCredential($credential))
{
foreach ($this->credentials as $indice => $current)
{
if ($credential == $current)
{
if (sfConfig::get('sf_logging_active')) $this->getContext()->getLogger()->info('{sfUser} remove credential "'.$credential.'"');
unset($this->credentials[$indice]);
return;
}
}
}
}
This may have been already corrected in 0.6.2 though, i didnt find a ticket about it but i'm not very familiar with trac.