Skip to content

Commit

Permalink
Prevent unserialize with no options
Browse files Browse the repository at this point in the history
  • Loading branch information
ElGigi committed Dec 4, 2024
1 parent 230eb62 commit 50a7ed0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. This projec
to [Semantic Versioning] (http://semver.org/). For change log format,
use [Keep a Changelog] (http://keepachangelog.com/).

## [2.5.2] - 2024-12-04

### Fixed

- Prevent unserialize with no options

## [2.5.1] - 2024-12-03

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions src/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public function __serialize(): array
*/
public function __unserialize(array $data): void
{
$this->options = $data['options'];
$this->routes = $data['routes'];
$this->options = $data['options'] ?? [];
$this->routes = $data['routes'] ?? [];
}

/**
Expand Down

0 comments on commit 50a7ed0

Please sign in to comment.