aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2016-11-28 09:23:04 +0100
committerGitHub <noreply@github.com>2016-11-28 09:23:04 +0100
commit6bb0866cf513bf939eb2e3290d1852c55e51ec0d (patch)
treece69e28c3cce2f562005d8ba7c357fb69647807d /src
parent5b644798a09f87e07dde95a85ab283affd7b3659 (diff)
parent5b6888b13fd44705a232261862a5cc96cebd0a7d (diff)
downloadwallabag-6bb0866cf513bf939eb2e3290d1852c55e51ec0d.tar.gz
wallabag-6bb0866cf513bf939eb2e3290d1852c55e51ec0d.tar.zst
wallabag-6bb0866cf513bf939eb2e3290d1852c55e51ec0d.zip
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.
Diffstat (limited to 'src')
-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}