diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index f4fceb0..21e0421 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -49,6 +49,11 @@ class Application extends App implements IBootstrap */ protected $user; + /** + * @var Request + */ + protected $request; + public function __construct(array $urlParams = []) { parent::__construct(self::APP_ID, $urlParams); @@ -96,6 +101,7 @@ class Application extends App implements IBootstrap $this->config = \OC::$server->getConfig(); $this->cspnm = \OC::$server->getContentSecurityPolicyNonceManager(); $this->user = \OC::$server[IUserSession::class]->getUser(); + $this->request = \OC::$server->getRequest(); if (!$this->isEnabled()) { return; @@ -106,7 +112,7 @@ class Application extends App implements IBootstrap protected function isEnabled(): bool { - if (isset($_SERVER["HTTP_USER_AGENT"]) && preg_match('/MemoriesNative/', $_SERVER['HTTP_USER_AGENT'])) { + if (isset($this->request->server['HTTP_USER_AGENT']) && preg_match('/MemoriesNative/', $this->request->server['HTTP_USER_AGENT'])) { return false; }