summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-07-19 11:35:10 +0200
committerGitHub <noreply@github.com>2016-07-19 11:35:10 +0200
commit544c3c156546d43912808ac18a13eba09f76aa3a (patch)
treee567d4842f90f4b5de840f4289291659b5f8b58f
parent0a6d95b1265be8755add34ff860764173197f57a (diff)
parentb1d652e8b05f6edd65aadc57a39e1738b036f5d3 (diff)
downloadnextcloud-server-544c3c156546d43912808ac18a13eba09f76aa3a.tar.gz
nextcloud-server-544c3c156546d43912808ac18a13eba09f76aa3a.zip
Merge pull request #436 from nextcloud/public-regex-to-match-our-clients
Copy the regexes to the public interface
-rw-r--r--lib/private/AppFramework/Http/Request.php12
-rw-r--r--lib/public/IRequest.php14
2 files changed, 25 insertions, 1 deletions
diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php
index eca02b2ac2b..d9cf1919252 100644
--- a/lib/private/AppFramework/Http/Request.php
+++ b/lib/private/AppFramework/Http/Request.php
@@ -67,10 +67,20 @@ class Request implements \ArrayAccess, \Countable, IRequest {
// Android Chrome user agent: https://developers.google.com/chrome/mobile/docs/user-agent
const USER_AGENT_ANDROID_MOBILE_CHROME = '#Android.*Chrome/[.0-9]*#';
const USER_AGENT_FREEBOX = '#^Mozilla/5\.0$#';
+ const REGEX_LOCALHOST = '/^(127\.0\.0\.1|localhost)$/';
+
+ /**
+ * @deprecated use \OCP\IRequest::USER_AGENT_CLIENT_IOS instead
+ */
const USER_AGENT_OWNCLOUD_IOS = '/^Mozilla\/5\.0 \(iOS\) ownCloud\-iOS.*$/';
+ /**
+ * @deprecated use \OCP\IRequest::USER_AGENT_CLIENT_ANDROID instead
+ */
const USER_AGENT_OWNCLOUD_ANDROID = '/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/';
+ /**
+ * @deprecated use \OCP\IRequest::USER_AGENT_CLIENT_DESKTOP instead
+ */
const USER_AGENT_OWNCLOUD_DESKTOP = '/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/';
- const REGEX_LOCALHOST = '/^(127\.0\.0\.1|localhost)$/';
protected $inputStream;
protected $content;
diff --git a/lib/public/IRequest.php b/lib/public/IRequest.php
index 86756413cd8..4db1c18b9c1 100644
--- a/lib/public/IRequest.php
+++ b/lib/public/IRequest.php
@@ -61,6 +61,20 @@ namespace OCP;
* @since 6.0.0
*/
interface IRequest {
+ /**
+ * @since 9.1.0
+ */
+ const USER_AGENT_CLIENT_ANDROID = '/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/';
+
+ /**
+ * @since 9.1.0
+ */
+ const USER_AGENT_CLIENT_DESKTOP = '/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/';
+
+ /**
+ * @since 9.1.0
+ */
+ const USER_AGENT_CLIENT_IOS = '/^Mozilla\/5\.0 \(iOS\) ownCloud\-iOS.*$/';
/**
* @param string $name