diff options
author | Andrew Kovalyov <andrew.kovalyoff@gmail.com> | 2016-11-28 01:15:06 +0200 |
---|---|---|
committer | Andrew Kovalyov <andrew.kovalyoff@gmail.com> | 2016-11-28 01:15:06 +0200 |
commit | 5b6888b13fd44705a232261862a5cc96cebd0a7d (patch) | |
tree | e3d5a370d5f50d75e1a7f6ffe59462d05976ec94 /src/Wallabag/CoreBundle | |
parent | 625bb561813222aea8a7a2e84e30e9f9de697017 (diff) | |
download | wallabag-5b6888b13fd44705a232261862a5cc96cebd0a7d.tar.gz wallabag-5b6888b13fd44705a232261862a5cc96cebd0a7d.tar.zst wallabag-5b6888b13fd44705a232261862a5cc96cebd0a7d.zip |
Fix incorrect reading time calculation for entries in languages with
non-latin chars subset.
Diffstat (limited to 'src/Wallabag/CoreBundle')
-rw-r--r-- | src/Wallabag/CoreBundle/Tools/Utils.php | 2 |
1 files changed, 1 insertions, 1 deletions
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 | |||
29 | */ | 29 | */ |
30 | public static function getReadingTime($text) | 30 | public static function getReadingTime($text) |
31 | { | 31 | { |
32 | return floor(str_word_count(strip_tags($text)) / 200); | 32 | return floor(count(preg_split('~[^\p{L}\p{N}\']+~u', strip_tags($text))) / 200); |
33 | } | 33 | } |
34 | } | 34 | } |