Skip to content

Commit

Permalink
Fix php 8.0 - must be a valid hashing algorithm (barryvdh#1419)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikn69 authored Jul 6, 2023
1 parent 8ac7c19 commit 23f6174
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/DataCollector/QueryCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,10 @@ protected function findViewFromHash($hash)
$this->reflection['viewfinderViews'] = $property;
}

$xxh128Exists = in_array('xxh128', hash_algos());

foreach ($property->getValue($finder) as $name => $path) {
if (hash('xxh128', 'v2' . $path) == $hash || sha1('v2' . $path) == $hash) {
if (($xxh128Exists && hash('xxh128', 'v2' . $path) == $hash) || sha1('v2' . $path) == $hash) {
return $name;
}
}
Expand Down

0 comments on commit 23f6174

Please sign in to comment.