Merge pull request 'release v5.1.0' (#428) from develop into master
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/security Pipeline was successful

Reviewed-on: #428
This commit is contained in:
Simon Vieille 2025-04-30 13:01:55 +02:00
commit a4e459d8ed
4 changed files with 16 additions and 18 deletions

View file

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

View file

@ -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/).
]]></description>
<version>5.0.3</version>
<version>5.1.0</version>
<licence>agpl</licence>
<author mail="contact@deblan.fr" homepage="https://www.deblan.fr/">Simon Vieille</author>
<namespace>SideMenu</namespace>

View file

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

View file

@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<template>
<NcColorPicker
v-model="model"
:advancedFields="true"
class="cm-settings-form-colorpicker"
>
<div