From 29ff0549a569d26f32e9e8fa6b0a684be504f152 Mon Sep 17 00:00:00 2001 From: Priyanka Karan Date: Fri, 20 May 2016 12:38:26 +0100 Subject: [PATCH] condition check to avoid in_array warning --- fancytokens.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/fancytokens.php b/fancytokens.php index 5925259..7705824 100644 --- a/fancytokens.php +++ b/fancytokens.php @@ -81,14 +81,16 @@ function fancytokens_civicrm_tokens( &$tokens ){ } $type_array = explode( "," , $p_type); // Contributions Activity - if ( false == ( in_array("Participant", $type_array ) || in_array("Membership", $type_array ) || in_array("Household", $type_array ) || in_array("Contributions", $type_array ) || in_array("Activity", $type_array ) )) { - - $key = 'communitynews.standaloneprofile___'.$cur['id'] ; - $label = $cur['title'].' (id: '.$cur['id'].') :: Forms'; - - $tokens['communitynews'][$key] = $label; - - + if ( is_array( $type_array ) ) { + if ( false == ( in_array("Participant", $type_array ) || in_array("Membership", $type_array ) || in_array("Household", $type_array ) || in_array("Contributions", $type_array ) || in_array("Activity", $type_array ) )) { + + $key = 'communitynews.standaloneprofile___'.$cur['id'] ; + $label = $cur['title'].' (id: '.$cur['id'].') :: Forms'; + + $tokens['communitynews'][$key] = $label; + + + } } }