diff --git a/README.md b/README.md index 9f8b270..1afa799 100644 --- a/README.md +++ b/README.md @@ -182,4 +182,4 @@ public function updateCollateContentFields($content) { ## Version -1.1.1 +1.1.2 diff --git a/src/Analysis/FocusKeywordContentAnalysis.php b/src/Analysis/FocusKeywordContentAnalysis.php index b1bcdfb..a5d8473 100644 --- a/src/Analysis/FocusKeywordContentAnalysis.php +++ b/src/Analysis/FocusKeywordContentAnalysis.php @@ -39,12 +39,12 @@ public function findOccurrences() public function getContentFromDom() { $dom = $this->getPage()->getRenderedHtmlDomParser(); - + if (!$dom) { return ''; } - + $result = $dom->find('body', 0); return strtolower(strip_tags($result ? $result->innertext() : '')); @@ -55,7 +55,11 @@ public function getContentFromDom() */ public function getKeyword() { - return strtolower($this->getPage()->FocusKeyword); + if ($keyword = $this->getPage()->FocusKeyword) { + return strtolower($keyword); + } + + return ''; } /** diff --git a/src/Analysis/FocusKeywordUniqueAnalysis.php b/src/Analysis/FocusKeywordUniqueAnalysis.php index 46b0ae9..da2a801 100644 --- a/src/Analysis/FocusKeywordUniqueAnalysis.php +++ b/src/Analysis/FocusKeywordUniqueAnalysis.php @@ -17,7 +17,11 @@ class FocusKeywordUniqueAnalysis extends Analysis */ public function getKeyword() { - return strtolower($this->getPage()->FocusKeyword); + if ($keyword = $this->getPage()->FocusKeyword) { + return strtolower($keyword); + } + + return ''; } /** diff --git a/src/Analysis/FocusKeywordUrlAnalysis.php b/src/Analysis/FocusKeywordUrlAnalysis.php index 700e657..d725cf8 100644 --- a/src/Analysis/FocusKeywordUrlAnalysis.php +++ b/src/Analysis/FocusKeywordUrlAnalysis.php @@ -24,7 +24,11 @@ class FocusKeywordUrlAnalysis extends Analysis */ public function getKeyword() { - return strtolower($this->getPage()->FocusKeyword); + if ($keyword = $this->getPage()->FocusKeyword) { + return strtolower($keyword); + } + + return ''; } /**