Skip to content

Commit

Permalink
[J#PEAK-1837][BUG] Ensure $user_consents is an array (#48)
Browse files Browse the repository at this point in the history
[J#PEAK-1837][BUG] Ensure $user_consents is an array
  • Loading branch information
strayobject authored Nov 13, 2019
2 parents 49d3bde + 3e70f28 commit 7edc1a5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions admin/class-gdpr-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,12 @@ public function edit_user_profile( $user ) {
} else {
$user_consents = get_user_meta( $user->ID, 'gdpr_consents' );
}
/**
* in_array() on line 914 expects $user_consents to be an array.
*/
if ( ! is_array( $user_consents ) ) {
$user_consents = [ $user_consents ];
}
if ( empty( $consent_types ) ) {
return;
}
Expand Down

0 comments on commit 7edc1a5

Please sign in to comment.