better deletion of old avatars

darcs-hash:20080518193951-84dde-cc45fbfba1f11a4ae2f629cc862e02a14743f2c1.gz
This commit is contained in:
Evan Prodromou 2008-05-18 15:39:51 -04:00
parent a4789e79c8
commit 6396504aa6

View File

@ -205,8 +205,10 @@ class AvatarAction extends SettingsAction {
$avatar->profile_id = $user->id;
$avatar->find();
while ($avatar->fetch()) {
unlink(common_avatar_path($avatar->filename));
$avatar->delete();
}
return true;
}
}