Skip to content

Commit 57beb36

Browse files
committed
Fix issue with long meta and og description
1 parent 1213b48 commit 57beb36

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Block/Post/View/Opengraph.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function getDescription()
4848
$content = trim($this->stripTags($this->getPost()->getContent()));
4949
$max = 300;
5050
if (mb_strlen($content) > $max) {
51-
$content = mb_substr($content, $max);
51+
$content = mb_substr($content, 0, $max);
5252
}
5353

5454
return $content;

Model/Post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public function getMetaDescription()
222222

223223
$desc = strip_tags($desc);
224224
if (mb_strlen($desc) > 160) {
225-
$desc = mb_substr($desc, 160);
225+
$desc = mb_substr($desc, 0, 160);
226226
}
227227

228228
return $desc;

0 commit comments

Comments
 (0)