From b405b265be0fbb6f8221288d46807c9fd2fc41b3 Mon Sep 17 00:00:00 2001 From: Paul Herring Date: Fri, 26 Feb 2021 15:43:43 +0000 Subject: [PATCH] #99 fix usort() comparison function to return signed int, instead of bool --- src/Readability.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Readability.php b/src/Readability.php index 6bcbf78d..332c9628 100644 --- a/src/Readability.php +++ b/src/Readability.php @@ -195,7 +195,7 @@ public function parse($html) // No luck after removing flags, just return the longest text we found during the different loops usort($this->attempts, function ($a, $b) { - return $a['textLength'] < $b['textLength']; + return $b['textLength'] - $a['textLength']; }); // But first check if we actually have something