Hello Catrope, jenkins-bot, Dbarratt, I'd like you to do a code review. Please visit
https://gerrit.wikimedia.org/r/384575 to review the following change. Change subject: Revert "ContainmentSet: Use strict comparison for array_search()" ...................................................................... Revert "ContainmentSet: Use strict comparison for array_search()" This reverts commit d4167ce99b988a062e36d25c81613827fea82dbf. Change-Id: I94b8e63094051359bdfab4aefb03fa0c908de5c2 --- M includes/ContainmentSet.php M tests/phpunit/ContainmentSetTest.php 2 files changed, 1 insertion(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo refs/changes/75/384575/1 diff --git a/includes/ContainmentSet.php b/includes/ContainmentSet.php index 0803da0..d5cfff5 100644 --- a/includes/ContainmentSet.php +++ b/includes/ContainmentSet.php @@ -111,8 +111,7 @@ */ public function contains( $value ) { foreach ( $this->lists as $list ) { - // Use strict comparison to prevent the number 0 from matching all strings (T177825) - if ( array_search( $value, $list->getValues(), true ) !== false ) { + if ( array_search( $value, $list->getValues() ) !== false ) { return true; } } diff --git a/tests/phpunit/ContainmentSetTest.php b/tests/phpunit/ContainmentSetTest.php index 5971c81..077e235 100644 --- a/tests/phpunit/ContainmentSetTest.php +++ b/tests/phpunit/ContainmentSetTest.php @@ -15,9 +15,6 @@ $list->addArray( [ 'whammo' ] ); $this->assertTrue( $list->contains( 'whammo' ) ); - - $list->addArray( [ 0 ] ); - $this->assertFalse( $list->contains( 'baz' ) ); } public function testCachedListInnerListIsOnlyCalledOnce() { -- To view, visit https://gerrit.wikimedia.org/r/384575 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I94b8e63094051359bdfab4aefb03fa0c908de5c2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Echo Gerrit-Branch: wmf/1.31.0-wmf.3 Gerrit-Owner: Thcipriani <tcipri...@wikimedia.org> Gerrit-Reviewer: Catrope <r...@wikimedia.org> Gerrit-Reviewer: Dbarratt <dbarr...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits