From 68129fd32dedec27477f166ae903346182b69dd7 Mon Sep 17 00:00:00 2001 From: k8n Date: Tue, 28 Aug 2018 13:50:16 -0400 Subject: [PATCH] Quick and dirty patch for #8 --- autoseo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoseo.php b/autoseo.php index fe0d3b0..c56bc3d 100644 --- a/autoseo.php +++ b/autoseo.php @@ -55,7 +55,7 @@ public function onPageInitialized() $metaSite = $this->config->get('site')['metadata']; // limit the content size to reduce the performance impact - $content = substr(strip_tags($page->content()),0, 1000 ); + $content = mb_substr(strip_tags($page->content()),0, 1000 ); $cleanContent = $this->cleanText ($content, $config); // here because we don't want to make this call several times $cleanTitle = $this->cleanString ($page->title()); // here because we don't want to make this call several times @@ -170,7 +170,7 @@ private function getMetaTwitter ($meta, $metaSite, $config, $cleanContent, $clea if (array_key_exists('description', $metaSite)) { $metaSiteContent = htmlspecialchars($metaSite['description'], ENT_QUOTES, 'UTF-8'); } else { $metaSiteContent = ''; } if ($meta['description']['content'] != $metaSiteContent) $cleanContent = $meta['description']['content']; } - $meta['twitter:description']['content'] = substr($cleanContent,0,140); + $meta['twitter:description']['content'] = mb_substr($cleanContent,0,140); } if (!isset($meta['twitter:image'])) {