Skip to content

Commit

Permalink
Merge pull request #3 from geekwright/fix-limit-unserialize
Browse files Browse the repository at this point in the history
Support pre PHP 7.0 cleanly
  • Loading branch information
geekwright authored Apr 30, 2023
2 parents 612f44e + fbe2e49 commit c87227e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/PublicSuffixList.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ protected function readCachedPSL($url)
$cacheFile = $this->getCacheFileName($url);
if (file_exists($cacheFile)) {
$cachedTree = file_get_contents($cacheFile);
if(PHP_VERSION_ID < 070000) {
return unserialize($cachedTree);
}
return unserialize($cachedTree, array('allowed_classes' => false));
}
return false;
Expand Down

0 comments on commit c87227e

Please sign in to comment.