Skip to content

Commit

Permalink
[Open311] Consistent protected field ordering.
Browse files Browse the repository at this point in the history
Without this sort, the protected fields could be pushed on in any order.
If more than one of those protected fields then had the same sort order,
they could be sorted in that pushed-on order, which could change between
runs.
  • Loading branch information
dracos committed Apr 26, 2021
1 parent 89dd348 commit 53c667c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -33,6 +33,8 @@
- Development improvements:
- Include failure count in send report error output, #3316
- Sort output in export script. #3323
- Open311 improvements:
- Consistent protected field ordering.
- Security:
- Increase minimum password length to eight.

Expand Down
3 changes: 2 additions & 1 deletion perllib/Open311/PopulateServiceList.pm
Expand Up @@ -251,7 +251,8 @@ sub _add_meta_to_contact {
@{ $meta_data->{attributes} };

# and then add back in any protected fields that we don't fetch
push @meta, values %$protected;
# sort by code for consistent sort order later on
push @meta, sort { $a->{code} cmp $b->{code} } values %$protected;

# turn the data into something a bit more friendly to use
@meta =
Expand Down

0 comments on commit 53c667c

Please sign in to comment.