aboutsummaryrefslogtreecommitdiffstats
path: root/apps/workflowengine/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2018-02-27 22:27:26 +0100
committerGitHub <noreply@github.com>2018-02-27 22:27:26 +0100
commitb369abc37807c105a72cc302dd1f9d98cf2813d1 (patch)
tree7fe3e180dfc99fe3ec3af313a31595e239dfae83 /apps/workflowengine/lib
parent77927442a65040389333a0d12b15b8d9eba4d0ae (diff)
parentf81d4eb060ea15c0c753d094b65eaa2c8c9315a5 (diff)
downloadnextcloud-server-b369abc37807c105a72cc302dd1f9d98cf2813d1.tar.gz
nextcloud-server-b369abc37807c105a72cc302dd1f9d98cf2813d1.zip
Merge pull request #8565 from nextcloud/bugfix/fat-48/make-outlook-and-thunderbird-addons-identifyable
Make the Outlook and Thunderbird addons identifyable
Diffstat (limited to 'apps/workflowengine/lib')
-rw-r--r--apps/workflowengine/lib/Check/RequestUserAgent.php12
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);