Skip to content
This repository has been archived by the owner on Nov 7, 2020. It is now read-only.

Commit

Permalink
Merge pull request #9 from k8n/patch-1
Browse files Browse the repository at this point in the history
Quick and dirty patch for #8
  • Loading branch information
LaurentOngaro authored Sep 1, 2018
2 parents 7c0eb3c + 68129fd commit c0246ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions autoseo.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'])) {
Expand Down

0 comments on commit c0246ab

Please sign in to comment.