From d485b728e7978017f1e1f93dfaea7f54437dd517 Mon Sep 17 00:00:00 2001 From: llaumgui Date: Wed, 30 Apr 2025 09:30:35 +0200 Subject: [PATCH 1/6] 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; } -- 2.47.3 From 4bea4afb07f6948bf0b9a3821521c223e03546f6 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 30 Apr 2025 12:45:32 +0200 Subject: [PATCH 2/6] refactor(Application): add properties types --- lib/AppInfo/Application.php | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 21e0421..0f73c70 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -2,8 +2,9 @@ namespace OCA\SideMenu\AppInfo; -use OC; +use OC\AllConfig; use OC\App\AppStore\Fetcher\CategoryFetcher; +use OC\AppFramework\Http\Request; use OC\Security\CSP\ContentSecurityPolicyNonceManager; use OC\User\User; use OCA\SideMenu\Service\AppRepository; @@ -31,28 +32,12 @@ use Psr\Container\ContainerInterface; class Application extends App implements IBootstrap { public const APP_ID = 'side_menu'; - public const APP_NAME = 'Custom menu'; - /** - * @var OC\AllConfig - */ - protected $config; - - /** - * @var ContentSecurityPolicyNonceManager - */ - protected $cspnm; - - /** - * @var User - */ - protected $user; - - /** - * @var Request - */ - protected $request; + protected AllConfig $config; + protected ContentSecurityPolicyNonceManager $cspnm; + protected Request $request; + protected ?User $user = null; public function __construct(array $urlParams = []) { -- 2.47.3 From 33ab7dff97ef80fa8f7c639b65869629413e84a6 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 30 Apr 2025 12:50:51 +0200 Subject: [PATCH 3/6] update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9279c3a..127f1ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## [Unreleased] +## 5.0.4 +### Fixed +* #422: usage of `OC\AppFramework\Http\Request` instead of `$_SERVER` + ## 5.0.3 ### Fixed * fix #422: undefined array key "HTTP_USER_AGENT" -- 2.47.3 From d2730afe9f20db788674e368b7724ca40d4a9a54 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 30 Apr 2025 12:57:13 +0200 Subject: [PATCH 4/6] fix #425: allow to set a color using hex code --- src/components/settings/form/FormColorPicker.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/settings/form/FormColorPicker.vue b/src/components/settings/form/FormColorPicker.vue index d13d578..904fa95 100644 --- a/src/components/settings/form/FormColorPicker.vue +++ b/src/components/settings/form/FormColorPicker.vue @@ -17,6 +17,7 @@ along with this program. If not, see .