From 50a7ed0f326e2863b85dc7898e802ad146eded57 Mon Sep 17 00:00:00 2001 From: Ronan Giron Date: Wed, 4 Dec 2024 09:55:57 +0100 Subject: [PATCH] Prevent unserialize with no options --- CHANGELOG.md | 6 ++++++ src/Router.php | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e381e92..0f66a0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/Router.php b/src/Router.php index 89e2c10..355e84e 100644 --- a/src/Router.php +++ b/src/Router.php @@ -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'] ?? []; } /**