Make sure new picture is saved to DB even when form has errors

This commit is contained in:
moodler
2004-04-30 04:44:47 +00:00
parent 806021014b
commit 1aacb5033d
+1
View File
@@ -69,6 +69,7 @@
if (find_form_errors($user, $usernew, $err)) {
if ($filename = valid_uploaded_file($_FILES['imagefile'])) {
$usernew->picture = save_profile_image($user->id, $filename);
set_field('user', 'picture', $usernew->picture, 'id', $user->id); /// Note picture in DB
}
$user = $usernew;