fix unsetting profile fields

This commit is contained in:
Pachira 2016-12-11 16:57:40 +01:00
parent d6abd02a3b
commit 705634e189

View file

@ -43,7 +43,11 @@ class AccountController extends Controller
];
foreach ($allowed as $field) {
$save["user_{$field}"] = $_POST["profile_{$field}"] ?? null;
$profile_field = "profile_{$field}";
$save["user_{$field}"] = isset($_POST[$profile_field]) && strlen($_POST[$profile_field])
? $_POST[$profile_field]
: null;
}
DB::table('users')