Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions library/Falcon/Connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,13 @@ public function save_profile_settings( $user_id, $args = array(), $sites = null
}
$value = $args[ $request_key ];

// Check the value is valid
$options = array_keys( $options );
if ( ! in_array( $value, $options ) ) {
// Check the value is valid.
// Use a fresh local so we don't mutate the outer foreach's $options —
// on subsequent sites that would leave $options as a numeric-indexed
// list, and on PHP 8+ in_array() with non-numeric strings against ints
// no longer loose-equates, so all sites after the first silently skip.
$valid_values = array_keys( $options );
if ( ! in_array( $value, $valid_values, true ) ) {
continue;
}

Expand Down