From d485b728e7978017f1e1f93dfaea7f54437dd517 Mon Sep 17 00:00:00 2001 From: llaumgui Date: Wed, 30 Apr 2025 09:30:35 +0200 Subject: [PATCH] Use Request object --- lib/AppInfo/Application.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; }