Skip to content

Commit

Permalink
remove PHP_VERSION_ID < 70000
Browse files Browse the repository at this point in the history
  • Loading branch information
mambax7 committed Jul 1, 2024
1 parent c573cd5 commit 1d51935
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/PublicSuffixList.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,16 +224,12 @@ protected function getCacheFileName($url)
protected function readCachedPSL($url)
{
$cacheFile = $this->getCacheFileName($url);
if (file_exists($cacheFile)) {
$cachedTree = file_get_contents($cacheFile);
if (PHP_VERSION_ID < 70000) {
return unserialize($cachedTree);
}
return unserialize($cachedTree, ['allowed_classes' => false]);
}
return false;
return file_exists($cacheFile)
? unserialize(file_get_contents($cacheFile), ['allowed_classes' => false])
: false;
}


/**
* Cache the current Public Suffix List tree and associate with the specified source
*
Expand Down

0 comments on commit 1d51935

Please sign in to comment.