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:
commit
6bb0866cf5
5 changed files with 54 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue