aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag
diff options
context:
space:
mode:
authorlizyn <zhiylin7@gmail.com>2018-12-25 15:31:44 +0800
committerlizyn <zhiylin7@gmail.com>2018-12-25 15:31:44 +0800
commit5becf260fafd741fd34948f12131d8074dc2b5dc (patch)
treea1e13de25be70cf57ee55d6b6d2f2e48e2e3d00b /src/Wallabag
parent4d0c632c70ea50d459c3c55ddda2e0f394dd51cb (diff)
downloadwallabag-5becf260fafd741fd34948f12131d8074dc2b5dc.tar.gz
wallabag-5becf260fafd741fd34948f12131d8074dc2b5dc.tar.zst
wallabag-5becf260fafd741fd34948f12131d8074dc2b5dc.zip
fix incorrect reading time calculation for entries with CJK characters
Diffstat (limited to 'src/Wallabag')
-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 46bb1dc5..0a805210 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(\count(preg_split('~[^\p{L}\p{N}\']+~u', strip_tags($text))) / 200); 32 return floor(\count(preg_split('~([^\p{L}\p{N}\']+|\p{Han}|\p{Hiragana}|\p{Katakana}|\p{Hangul})~u', strip_tags($text))) / 200);
33 } 33 }
34} 34}