Skip to content

Commit

Permalink
CRM_Mailing_ActionTokens - Degarde gracefully
Browse files Browse the repository at this point in the history
Most of the `CRM_*_Tokens` classes include a `checkActive()` function whic
prevents them from trying to do anything if they don't have the necessary
data.  However, this one was missing it, which means that it attempts to
evalute `{action.*}` tokens even when they're not valid.
  • Loading branch information
totten committed Feb 23, 2017
1 parent 7927bd0 commit 9091e03
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CRM/Mailing/ActionTokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ public function __construct() {
));
}

/**
* @inheritDoc
*/
public function checkActive(\Civi\Token\TokenProcessor $processor) {
return !empty($processor->context['mailingId']) || !empty($processor->context['mailing']);
}

/**
* @inheritDoc
*/
Expand Down

0 comments on commit 9091e03

Please sign in to comment.