Spread work of computing getSnippets to all servers not just name server take 3, a=chris
Spread work of computing getSnippets to all servers not just name server take 3, a=chris
diff --git a/src/models/Model.php b/src/models/Model.php
index 0eefba619..5f757a837 100755
--- a/src/models/Model.php
+++ b/src/models/Model.php
@@ -373,9 +373,10 @@ class Model implements CrawlConstants
if (mb_strlen($snippet_string) >= $description_length) {
$snippet_string = mb_substr($snippet_string, 0,
$description_length);
- $rpos = strrpos($snippet_string, " ");
- if ($rpos) {
- $snippet_string = mb_substr($snippet_string, 0, $rpos);
+ $test_snippet = preg_replace('/[^\s]+$/', "",
+ $snippet_string);
+ if(!empty($test_snippet)) {
+ $snippet_string = $test_snippet;
}
break;
}