From 2756c3249b7039a0e85e09211089a2b6cdc7b98d Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 28 Jun 2020 08:18:35 +0200 Subject: [PATCH] Fix notice "Undefined index: keywords" --- src/Content/PageInfo.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Content/PageInfo.php b/src/Content/PageInfo.php index 7d6f2eb9ff..73e2f62932 100644 --- a/src/Content/PageInfo.php +++ b/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);