Skip to content

Commit 43b9ace

Browse files
committed
Fix strict check in invite_anyone_access_test() refactor.
The coding standard changes in d4d6e6f included a change to strict type checking in `in_array()` for the user id blacklist, which broke what should have been legitimate items on the blacklist. We fix this by enforcing the integer type on these blacklist items. See #154, #153.
1 parent 1cd2e1a commit 43b9ace

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

by-email/by-email.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,8 @@ function invite_anyone_access_test() {
398398
/* User blacklist */
399399
elseif ( isset( $iaoptions['email_blacklist_toggle'] ) && 'yes' === $iaoptions['email_blacklist_toggle'] ) {
400400
if ( isset( $iaoptions['email_blacklist'] ) ) {
401-
$blacklist = explode( ',', $iaoptions['email_blacklist'] );
402-
$user_id = $current_user->ID;
401+
$blacklist = wp_parse_id_list( $iaoptions['email_blacklist'] );
402+
$user_id = intval( $current_user->ID );
403403
if ( in_array( $user_id, $blacklist, true ) ) {
404404
$access_allowed = false;
405405
}

0 commit comments

Comments
 (0)