Fixed a bug in Route::withParam() method

This commit is contained in:
Matias Griese
2019-06-20 00:45:59 +03:00
parent ac9ef4da76
commit b398d04d96
2 changed files with 5 additions and 3 deletions

View File

@@ -4,6 +4,7 @@
1. [](#bugfix)
* Fixed error in `ImageMedium::url()` if the image cache folder does not exist
* Fixed empty form flash name after update
* Fixed a bug in `Route::withParam()` method
# v1.6.10
## 06/14/2019

View File

@@ -313,9 +313,9 @@ class Route
*/
protected function withParam($type, $param, $value)
{
$oldValue = $this->{$type}[$param] ?? null;
$typeValue = $this->{$type}[$param] ?? null;
if ($oldValue === $value) {
if ($typeValue === $value) {
return $this;
}
@@ -323,7 +323,8 @@ class Route
if ($value === null) {
unset($new->{$type}[$param]);
} else {
$new->{$type}[$param] = $value;
$typeValue[$param] = $value;
$new->{$type} = $typeValue;
}
return $new;