Skip to content

Commit

Permalink
Item9664: make sure that registration can't create invalid META:FIELD…
Browse files Browse the repository at this point in the history
… entries

git-svn-id: http://svn.foswiki.org/trunk@9064 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
CrawfordCurrie authored and CrawfordCurrie committed Sep 13, 2010
1 parent 32231df commit 5ec8409
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion core/lib/Foswiki/UI/Register.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,16 @@ sub _populateUserTopicForm {
next unless $fd->{name} eq $field->{name};
next if $SKIPKEYS{ $fd->{name} };
my $item = $meta->get( 'FIELD', $fd->{name} );
$item->{value} = $fd->{value};
if ($item) {
$item->{value} = $fd->{value};
} else {
# Field missing from the new user template - create
# from scratch
$item = {
name => $fd->{name},
value => $fd->{value},
};
}
$meta->putKeyed( 'FIELD', $item );
$inform{ $fd->{name} } = 1;
last;
Expand Down

0 comments on commit 5ec8409

Please sign in to comment.