From 4dc352a4f2c6e98eb345462d7315ad9989ae260a Mon Sep 17 00:00:00 2001 From: Shady Sharaf Date: Wed, 5 Feb 2014 20:14:05 +0200 Subject: [PATCH] Assume that `in` operator will always be passed an array #69 --- classes/wp-stream-notification-rule-match.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/classes/wp-stream-notification-rule-match.php b/classes/wp-stream-notification-rule-match.php index a071600ae..1468da70b 100644 --- a/classes/wp-stream-notification-rule-match.php +++ b/classes/wp-stream-notification-rule-match.php @@ -132,11 +132,9 @@ public function match_trigger( $trigger, $log ) { $match = ( $haystack == $needle ); case 'in': case '!in': - $match = array_filter( - (array) $needle, - function( $value ) use ( $haystack ) { - return $value == $haystack; - } + $match = (bool) array_intersect( + explode( ',', $needle ), + (array) $haystack ); break; // string special comparison operators