Permalink
Browse files

fix(profile): use correct default access for profile fields

In exceptional use cases the access level of a profile field could be
set to an unsupported access level

fixes #9982
  • Loading branch information...
jeabakker committed Sep 23, 2016
1 parent 5ad0f46 commit 63a01b6f8c9314ddae5819e8194938c988871a60
Showing with 5 additions and 1 deletion.
  1. +5 −1 actions/profile/edit.php
View
@@ -82,6 +82,10 @@ function profile_array_decoder(&$v) {
// go through custom fields
if (sizeof($input) > 0) {
// fetch default access level for the user for use in fallback cases
$user_default_access = get_default_access($owner);
foreach ($input as $shortname => $value) {
$options = array(
'guid' => $owner->guid,
@@ -98,7 +102,7 @@ function profile_array_decoder(&$v) {
$access_id = (int) $accesslevel[$shortname];
} else {
// this should never be executed since the access level should always be set
$access_id = ACCESS_DEFAULT;
$access_id = $user_default_access;
}
if (is_array($value)) {
$i = 0;

0 comments on commit 63a01b6

Please sign in to comment.