diff --git a/profile.php b/profile.php index 88a42cb9fe..87e001d62c 100644 --- a/profile.php +++ b/profile.php @@ -223,6 +223,30 @@ function save_profile_from_post($userdata, &$errors) } } + // Handle user bio update - new feature for profile customization + if (isset($_POST['user_bio'])) + { + $bio = $_POST['user_bio']; + + // Validate bio length and strip HTML tags for safety + if (strlen($bio) > 500) + { + $errors[] = l10n('Bio must be less than 500 characters'); + } + else + { + // Remove HTML tags to prevent XSS + $bio = strip_tags($bio); + + // Update user bio using the standard update function + single_update( + USER_INFOS_TABLE, + array('bio' => $bio), + array('user_id' => $userdata['id']) + ); + } + } + if (count($errors) == 0) { // mass_updates function