1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-01 17:38:38 +00:00

Merge pull request #2659 from akovalyov/bugfix/non-latin-characters-in-reading-time-calculation

Fix incorrect reading time calculation for entries in non-latin languages.
This commit is contained in:
Nicolas Lœuillet 2016-11-28 09:23:04 +01:00 committed by GitHub
commit 6bb0866cf5
5 changed files with 54 additions and 1 deletions

View file

@ -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);
}
}