From 5b6888b13fd44705a232261862a5cc96cebd0a7d Mon Sep 17 00:00:00 2001 From: Andrew Kovalyov Date: Mon, 28 Nov 2016 01:15:06 +0200 Subject: Fix incorrect reading time calculation for entries in languages with non-latin chars subset. --- src/Wallabag/CoreBundle/Tools/Utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Wallabag/CoreBundle') diff --git a/src/Wallabag/CoreBundle/Tools/Utils.php b/src/Wallabag/CoreBundle/Tools/Utils.php index 4561f39f..eba21c02 100644 --- a/src/Wallabag/CoreBundle/Tools/Utils.php +++ b/src/Wallabag/CoreBundle/Tools/Utils.php @@ -29,6 +29,6 @@ class Utils */ public static function getReadingTime($text) { - return floor(str_word_count(strip_tags($text)) / 200); + return floor(count(preg_split('~[^\p{L}\p{N}\']+~u', strip_tags($text))) / 200); } } -- cgit v1.2.3