Skip to content

Commit

Permalink
Remove safe unserialization. Must be fixed later
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed Aug 15, 2022
1 parent 9463319 commit 61f7ecb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/TagBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,13 @@ private function findTagByFingerprint(string $fingerprint): ?array
/**
* @psalm-suppress MixedInferredReturnType
*
* @throws TypeError if the unserialized data doesn't unserialize to instances of RenderedTag
*
* @return array<string, list<RenderedTag>>
*/
private function unserialize(string $data): array
{
/** @psalm-suppress MixedReturnStatement */
return unserialize($data, ['allowed_classes' => [
RenderedTag::class,
]]);
return unserialize($data, [
'allowed_classes' => true,
]);
}
}
4 changes: 4 additions & 0 deletions tests/TagBagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,3 +340,7 @@ public function hasMessageMatching(string $regexp): bool
return false;
}
}

final class NotARenderedTag
{
}

0 comments on commit 61f7ecb

Please sign in to comment.