viewgit/inc/functions.php:22 Function utf8_encode() is deprecated [8192]

Yet more tweaks to format page results, a=chris

Chris Pollett [2019-07-12 22:Jul:th]
Yet more tweaks to format page results, a=chris
Filename
src/models/Model.php
diff --git a/src/models/Model.php b/src/models/Model.php
index 5f757a837..5b8a10d0c 100755
--- a/src/models/Model.php
+++ b/src/models/Model.php
@@ -275,6 +275,11 @@ class Model implements CrawlConstants
         } else {
             $page[self::DESCRIPTION] = mb_substr($page[self::DESCRIPTION],
                 0, $description_length);
+            $test_snippet = preg_replace('/[^\s]+$/', "",
+                $page[self::DESCRIPTION]);
+            if(!empty($test_snippet)) {
+                $page[self::DESCRIPTION] = $test_snippet;
+            }
         }
         $page[self::TITLE] = trim($page[self::TITLE], " .");
         $pre_description = preg_replace("/\p{C}+|^[^\p{L}]+/u", "",
ViewGit