File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
66and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
77
8+ ## v1.12.3
9+
10+ ### Fixed
11+
12+ - Fixed issue with unserialization of cached HTTP client requests causing errors
13+ due to uninitialized properties.
14+
815## v1.12.2
916
1017### Fixed
Original file line number Diff line number Diff line change @@ -502,4 +502,24 @@ public function __serialize(): array {
502502 'response ' => $ this ->response ,
503503 ];
504504 }
505+
506+ /**
507+ * Restore the object from serialized data.
508+ *
509+ * @throws LogicException If the serialized data is invalid.
510+ *
511+ * @param array<string, mixed> $data Serialized data.
512+ */
513+ public function __unserialize ( array $ data ): void {
514+ if ( ! isset ( $ data ['response ' ] ) || ! is_array ( $ data ['response ' ] ) ) {
515+ throw new LogicException ( 'Invalid serialized response data. ' );
516+ }
517+
518+ if ( isset ( $ data ['url ' ] ) ) {
519+ $ this ->url = is_string ( $ data ['url ' ] ) ? $ data ['url ' ] : null ;
520+ }
521+
522+ $ this ->response = $ data ['response ' ];
523+ $ this ->cached = true ;
524+ }
505525}
You can’t perform that action at this time.
0 commit comments