aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2023-07-11 11:36:54 +0200
committerGitHub <noreply@github.com>2023-07-11 11:36:54 +0200
commite285d72c10924999e1243ef0482498f32d6443c2 (patch)
treec951e01355497af5a3f93fef844431d694f3e601 /lib
parent12ee2581aa943da93054f7839fecc8f83eb3cee1 (diff)
parent33913ebc344f84de88b3e58accc137801e90edb4 (diff)
downloadnextcloud-server-e285d72c10924999e1243ef0482498f32d6443c2.tar.gz
nextcloud-server-e285d72c10924999e1243ef0482498f32d6443c2.zip
Merge pull request #38561 from nextcloud/feat/noid/allow-to-match-client-versions-with-regex
feat(request): Allow to match the client version with the IRequest::U…
Diffstat (limited to 'lib')
-rw-r--r--lib/public/IRequest.php24
1 files changed, 16 insertions, 8 deletions
diff --git a/lib/public/IRequest.php b/lib/public/IRequest.php
index 93f065500cb..bc1f88504a8 100644
--- a/lib/public/IRequest.php
+++ b/lib/public/IRequest.php
@@ -64,43 +64,51 @@ namespace OCP;
interface IRequest {
/**
* @since 9.1.0
+ * @since 28.0.0 The regex has a group matching the version number
*/
- public const USER_AGENT_CLIENT_ANDROID = '/^Mozilla\/5\.0 \(Android\) (ownCloud|Nextcloud)\-android.*$/';
+ public const USER_AGENT_CLIENT_ANDROID = '/^Mozilla\/5\.0 \(Android\) (?:ownCloud|Nextcloud)\-android\/([^ ]*).*$/';
/**
* @since 13.0.0
+ * @since 28.0.0 The regex has a group matching the version number
*/
- public const USER_AGENT_TALK_ANDROID = '/^Mozilla\/5\.0 \(Android\) Nextcloud\-Talk v.*$/';
+ public const USER_AGENT_TALK_ANDROID = '/^Mozilla\/5\.0 \(Android\) Nextcloud\-Talk v([^ ]*).*$/';
/**
* @since 9.1.0
+ * @since 28.0.0 The regex has a group matching the version number
*/
- public const USER_AGENT_CLIENT_DESKTOP = '/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/';
+ public const USER_AGENT_CLIENT_DESKTOP = '/^Mozilla\/5\.0 \([A-Za-z ]+\) (?:mirall|csyncoC)\/([^ ]*).*$/';
/**
* @since 26.0.0
+ * @since 28.0.0 The regex has a group matching the version number
*/
- public const USER_AGENT_TALK_DESKTOP = '/^Mozilla\/5\.0 \((?!Android|iOS)[A-Za-z ]+\) Nextcloud\-Talk v.*$/';
+ public const USER_AGENT_TALK_DESKTOP = '/^Mozilla\/5\.0 \((?!Android|iOS)[A-Za-z ]+\) Nextcloud\-Talk v([^ ]*).*$/';
/**
* @since 9.1.0
+ * @since 28.0.0 The regex has a group matching the version number
*/
- public const USER_AGENT_CLIENT_IOS = '/^Mozilla\/5\.0 \(iOS\) (ownCloud|Nextcloud)\-iOS.*$/';
+ public const USER_AGENT_CLIENT_IOS = '/^Mozilla\/5\.0 \(iOS\) (?:ownCloud|Nextcloud)\-iOS\/([^ ]*).*$/';
/**
* @since 13.0.0
+ * @since 28.0.0 The regex has a group matching the version number
*/
- public const USER_AGENT_TALK_IOS = '/^Mozilla\/5\.0 \(iOS\) Nextcloud\-Talk v.*$/';
+ public const USER_AGENT_TALK_IOS = '/^Mozilla\/5\.0 \(iOS\) Nextcloud\-Talk v([^ ]*).*$/';
/**
* @since 13.0.1
+ * @since 28.0.0 The regex has a group matching the version number
*/
- public const USER_AGENT_OUTLOOK_ADDON = '/^Mozilla\/5\.0 \([A-Za-z ]+\) Nextcloud\-Outlook v.*$/';
+ public const USER_AGENT_OUTLOOK_ADDON = '/^Mozilla\/5\.0 \([A-Za-z ]+\) Nextcloud\-Outlook v([^ ]*).*$/';
/**
* @since 13.0.1
+ * @since 28.0.0 The regex has a group matching the version number
*/
- public const USER_AGENT_THUNDERBIRD_ADDON = '/^Mozilla\/5\.0 \([A-Za-z ]+\) Nextcloud\-Thunderbird v.*$/';
+ public const USER_AGENT_THUNDERBIRD_ADDON = '/^Mozilla\/5\.0 \([A-Za-z ]+\) Nextcloud\-Thunderbird v([^ ]*).*$/';
/**
* @since 26.0.0