aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Tools
diff options
context:
space:
mode:
authorAndrew Kovalyov <andrew.kovalyoff@gmail.com>2016-11-28 01:15:06 +0200
committerAndrew Kovalyov <andrew.kovalyoff@gmail.com>2016-11-28 01:15:06 +0200
commit5b6888b13fd44705a232261862a5cc96cebd0a7d (patch)
treee3d5a370d5f50d75e1a7f6ffe59462d05976ec94 /src/Wallabag/CoreBundle/Tools
parent625bb561813222aea8a7a2e84e30e9f9de697017 (diff)
downloadwallabag-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/Tools')
-rw-r--r--src/Wallabag/CoreBundle/Tools/Utils.php2
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}