Skip to content

Commit

Permalink
Merge tag '2.2.9'
Browse files Browse the repository at this point in the history
Hotfix release 2.2.9

- Fix for: Get parameter array handled incorrectly
  • Loading branch information
stefanheimes committed May 1, 2023
2 parents 0c40c55 + 009192b commit 065ed3d
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions src/Filter/FilterUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file is part of MetaModels/core.
*
* (c) 2012-2019 The MetaModels team.
* (c) 2012-2023 The MetaModels team.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -12,7 +12,8 @@
*
* @package MetaModels/core
* @author Christian Schiffler <[email protected]>
* @copyright 2012-2019 The MetaModels team.
* @author Ingolf Steinhardt <[email protected]>
* @copyright 2012-2023 The MetaModels team.
* @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
* @filesource
*/
Expand Down Expand Up @@ -57,6 +58,16 @@ public function __construct(
array $getParameters = [],
array $slugParameters = []
) {
if (static::class !== __CLASS__) {
// @codingStandardsIgnoreStart
@\trigger_deprecation(
'metamodels/core',
'2.2',
static::class . ' should not extend ' . __CLASS__ . ' as it will become final in 3.0.'
);
// @codingStandardsIgnoreEnd
}

$this->setPage($page);
foreach ($getParameters as $name => $value) {
$this->setGet($name, $value);
Expand Down Expand Up @@ -139,12 +150,12 @@ public function getPageValue(string $name)
/**
* Add a slug parameter.
*
* @param string $name The slug name.
* @param string $value The slug value.
* @param string $name The slug name.
* @param string|list<string> $value The slug value.
*
* @return self
*/
public function setGet(string $name, string $value): self
public function setGet(string $name, $value): self
{
if (empty($value)) {
unset($this->getParameters[$name]);
Expand All @@ -161,9 +172,9 @@ public function setGet(string $name, string $value): self
*
* @param string $name The slug name.
*
* @return string
* @return string|list<string>|null
*/
public function getGet(string $name): ?string
public function getGet(string $name)
{
return ($this->getParameters[$name] ?? null);
}
Expand Down

0 comments on commit 065ed3d

Please sign in to comment.