diff --git a/CHANGELOG.md b/CHANGELOG.md index 9279c3a..98226ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ ## [Unreleased] +## 5.1.0 +### Added +* fix #425: allow to set a color using hex code +### Fixed +* #422: usage of `OC\AppFramework\Http\Request` instead of `$_SERVER` + ## 5.0.3 ### Fixed * fix #422: undefined array key "HTTP_USER_AGENT" diff --git a/appinfo/info.xml b/appinfo/info.xml index ad353fd..a5e08f9 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -30,7 +30,7 @@ Notice Because I believe in a free and decentralized Internet, [Gitnet](https://gitnet.fr) is **self-hosted at home**. In case of downtime, you can download **Custom Menu** from [here](https://kim.deblan.fr/~side_menu/). ]]> - 5.0.3 + 5.1.0 agpl Simon Vieille SideMenu diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index f4fceb0..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,23 +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; + protected AllConfig $config; + protected ContentSecurityPolicyNonceManager $cspnm; + protected Request $request; + protected ?User $user = null; public function __construct(array $urlParams = []) { @@ -96,6 +86,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 +97,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; } 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 .