diff options
author | Joas Schilling <coding@schilljs.com> | 2018-02-27 14:37:32 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2018-02-27 14:37:32 +0100 |
commit | f81d4eb060ea15c0c753d094b65eaa2c8c9315a5 (patch) | |
tree | 8d0f494efe078639bdc49872c9b58087a5a246a8 /apps/workflowengine/lib | |
parent | 640db3d5fed6ca6d274d64842100fa7216ae1d67 (diff) | |
download | nextcloud-server-f81d4eb060ea15c0c753d094b65eaa2c8c9315a5.tar.gz nextcloud-server-f81d4eb060ea15c0c753d094b65eaa2c8c9315a5.zip |
Make the Outlook and Thunderbird addons identifyable
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/workflowengine/lib')
-rw-r--r-- | apps/workflowengine/lib/Check/RequestUserAgent.php | 12 |
1 files changed, 10 insertions, 2 deletions
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); |