Merge pull request #436 from nextcloud/public-regex-to-match-our-clients

Copy the regexes to the public interface
This commit is contained in:
Morris Jobke 2016-07-19 11:35:10 +02:00 committed by GitHub
commit 544c3c1565
2 changed files with 27 additions and 3 deletions

View file

@ -67,11 +67,21 @@ 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 USER_AGENT_OWNCLOUD_IOS = '/^Mozilla\/5\.0 \(iOS\) ownCloud\-iOS.*$/';
const USER_AGENT_OWNCLOUD_ANDROID = '/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/';
const USER_AGENT_OWNCLOUD_DESKTOP = '/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/';
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)\/.*$/';
protected $inputStream;
protected $content;
protected $items = array();

View file

@ -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