diff --git a/Changes.md b/Changes.md index 08dc29e..5bf8174 100755 --- a/Changes.md +++ b/Changes.md @@ -1,5 +1,9 @@ # Changes +## 3.1.2 + +- Hit highlighting: avoid errors with PHP 8. + ## 3.0.0 - Pass twitter-text conformance 3.0.0 diff --git a/lib/Twitter/Text/HitHighlighter.php b/lib/Twitter/Text/HitHighlighter.php index 3008ad6..97bad52 100644 --- a/lib/Twitter/Text/HitHighlighter.php +++ b/lib/Twitter/Text/HitHighlighter.php @@ -141,7 +141,7 @@ public function highlight($tweet = null, array $hits = null) $offset = 0; $start_in_chunk = false; # Flatten the multidimensional hits array: - $hits_flat = call_user_func_array('array_merge', $hits); + $hits_flat = call_user_func_array('array_merge', array_values($hits)); $hits_flat_count = count($hits_flat); # Loop over the hit indices: for ($index = 0; $index < $hits_flat_count; $index++) {