Skip to content

Commit 23f6174

Browse files
authored
Fix php 8.0 - must be a valid hashing algorithm (#1419)
1 parent 8ac7c19 commit 23f6174

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/DataCollector/QueryCollector.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,10 @@ protected function findViewFromHash($hash)
392392
$this->reflection['viewfinderViews'] = $property;
393393
}
394394

395+
$xxh128Exists = in_array('xxh128', hash_algos());
396+
395397
foreach ($property->getValue($finder) as $name => $path) {
396-
if (hash('xxh128', 'v2' . $path) == $hash || sha1('v2' . $path) == $hash) {
398+
if (($xxh128Exists && hash('xxh128', 'v2' . $path) == $hash) || sha1('v2' . $path) == $hash) {
397399
return $name;
398400
}
399401
}

0 commit comments

Comments
 (0)