Instead of silently winding up with a bogus Message object having most
fields invalidly set to null, just throw an exception.
Bug: T210528
Change-Id: I79313f8acf3ebb1ef12dac30c362aa10c715f40b
*/
public function unserialize( $serialized ) {
$data = unserialize( $serialized );
+ if ( !is_array( $data ) ) {
+ throw new InvalidArgumentException( __METHOD__ . ': Invalid serialized data' );
+ }
+
$this->interface = $data['interface'];
$this->key = $data['key'];
$this->keysToTry = $data['keysToTry'];