From f81d4eb060ea15c0c753d094b65eaa2c8c9315a5 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 27 Feb 2018 14:37:32 +0100 Subject: Make the Outlook and Thunderbird addons identifyable Signed-off-by: Joas Schilling --- apps/workflowengine/lib/Check/RequestUserAgent.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'apps/workflowengine/lib') diff --git a/apps/workflowengine/lib/Check/RequestUserAgent.php b/apps/workflowengine/lib/Check/RequestUserAgent.php index 7a8d4a71acf..4191a2f3412 100644 --- a/apps/workflowengine/lib/Check/RequestUserAgent.php +++ b/apps/workflowengine/lib/Check/RequestUserAgent.php @@ -44,9 +44,9 @@ class RequestUserAgent extends AbstractStringCheck { * @param string $value * @return bool */ - public function executeCheck($operator, $value) { + public function executeCheck($operator, $value) { $actualValue = $this->getActualValue(); - if (in_array($operator, ['is', '!is'])) { + if (in_array($operator, ['is', '!is'], true)) { switch ($value) { case 'android': $operator = $operator === 'is' ? 'matches' : '!matches'; @@ -60,6 +60,14 @@ class RequestUserAgent extends AbstractStringCheck { $operator = $operator === 'is' ? 'matches' : '!matches'; $value = IRequest::USER_AGENT_CLIENT_DESKTOP; break; + case 'mail': + if ($operator === 'is') { + return $this->executeStringCheck('matches', IRequest::USER_AGENT_OUTLOOK_ADDON, $actualValue) + || $this->executeStringCheck('matches', IRequest::USER_AGENT_THUNDERBIRD_ADDON, $actualValue); + } + + return $this->executeStringCheck('!matches', IRequest::USER_AGENT_OUTLOOK_ADDON, $actualValue) + && $this->executeStringCheck('!matches', IRequest::USER_AGENT_THUNDERBIRD_ADDON, $actualValue); } } return $this->executeStringCheck($operator, $value, $actualValue); -- cgit v1.2.3