Enclose xml-invalid hash keys into attributes

classes
Vitaliy Filippov 2016-04-06 17:45:42 +03:00
parent 4b8bea7b17
commit 41cf047168
2 changed files with 4 additions and 1 deletions

View File

@ -932,7 +932,7 @@ sub xml_dump_simple
}
elsif ($data =~ 'HASH')
{
$r = join '', map { xml_element($_, '', xml_dump_simple($data->{$_})) } keys %$data;
$r = join '', map { xml_element((/^[a-z:_][a-z:_\.0-9]*$/is ? ($_, '') : ('i', { key => $_ })), xml_dump_simple($data->{$_})) } keys %$data;
}
elsif ($data =~ 'SCALAR')
{

View File

@ -371,6 +371,9 @@ sub _translate_comment {
attachment_id => $self->type('int', $attach_id),
count => $self->type('int', $comment->{count}),
};
if (Bugzilla->user->is_timetracker) {
$comment_hash->{work_time} = $self->type('double', $comment->{work_time});
}
return filter($filters, $comment_hash, $types, $prefix);
}