Merge remote-tracking branch 'MarcMichalsky/issue/39'

[#39] Trim project IDs when extracting from profile configuration
This commit is contained in:
Jens Schuppe 2020-09-25 15:36:16 +02:00
commit 69764ffc11

View file

@ -65,7 +65,12 @@ class CRM_Twingle_Profile {
*/
public function matches($project_id) {
$selector = $this->getAttribute('selector');
$project_ids = explode(',', $selector);
$project_ids = array_map(
function($project_id) {
return trim($project_id);
},
explode(',', $selector)
);
return in_array($project_id, $project_ids);
}