Fix notice "Undefined index: keywords"

pull/8823/head
Michael Vogel 2 years ago
parent c852e1479c
commit 2756c3249b
  1. 8
      src/Content/PageInfo.php

@ -176,7 +176,7 @@ class PageInfo
if (!$keywords) {
unset($data['keywords']);
} elseif ($keyword_denylist) {
} elseif ($keyword_denylist && !empty($data['keywords'])) {
$list = explode(', ', $keyword_denylist);
foreach ($list as $keyword) {
@ -205,8 +205,14 @@ class PageInfo
{
$data = self::queryUrl($url, $photo, true, $keyword_denylist);
if (empty($data['keywords'])) {
return [];
}
$taglist = [];
foreach ($data['keywords'] as $keyword) {
$hashtag = str_replace([' ', '+', '/', '.', '#', "'"],
['', '', '', '', '', ''], $keyword);

Loading…
Cancel
Save