From 705634e189f975426eb6269f83c34f695cf1d773 Mon Sep 17 00:00:00 2001 From: flashwave Date: Sun, 11 Dec 2016 16:57:40 +0100 Subject: [PATCH] fix unsetting profile fields --- app/Controllers/Settings/AccountController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Controllers/Settings/AccountController.php b/app/Controllers/Settings/AccountController.php index 0acc433..cf75d1e 100644 --- a/app/Controllers/Settings/AccountController.php +++ b/app/Controllers/Settings/AccountController.php @@ -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')