]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Tools/Utils.php
fix incorrect reading time calculation for entries with CJK characters
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Tools / Utils.php
index 46bb1dc5c82441cd8277f00dc121eec84298697e..0a805210872f812b3074595488436234f24e5e13 100644 (file)
@@ -29,6 +29,6 @@ class Utils
      */
     public static function getReadingTime($text)
     {
-        return floor(\count(preg_split('~[^\p{L}\p{N}\']+~u', strip_tags($text))) / 200);
+        return floor(\count(preg_split('~([^\p{L}\p{N}\']+|\p{Han}|\p{Hiragana}|\p{Katakana}|\p{Hangul})~u', strip_tags($text))) / 200);
     }
 }