diff options
-rw-r--r-- | articleenhancer/xpatharticleenhancer.php | 9 | ||||
-rw-r--r-- | utility/faviconfetcher.php | 9 | ||||
-rw-r--r-- | utility/simplepieapifactory.php | 2 |
3 files changed, 13 insertions, 7 deletions
diff --git a/articleenhancer/xpatharticleenhancer.php b/articleenhancer/xpatharticleenhancer.php index 0f541c2ce..4037d88ac 100644 --- a/articleenhancer/xpatharticleenhancer.php +++ b/articleenhancer/xpatharticleenhancer.php @@ -56,11 +56,14 @@ class XPathArticleEnhancer implements ArticleEnhancer { $file = $this->getFile($item->getUrl()); // convert encoding by detecting charset from header - $contentType = $file->headers['content-type']; + /** @noinspection PhpUndefinedFieldInspection */ + $contentType = $file->headers['content-type']; if( preg_match( '/(?<=charset=)[^;]*/', $contentType, $matches ) ) { - $body = mb_convert_encoding($file->body, 'HTML-ENTITIES', $matches[0]); + /** @noinspection PhpUndefinedFieldInspection */ + $body = mb_convert_encoding($file->body, 'HTML-ENTITIES', $matches[0]); } else { - $body = $file->body; + /** @noinspection PhpUndefinedFieldInspection */ + $body = $file->body; } $dom = new \DOMDocument(); diff --git a/utility/faviconfetcher.php b/utility/faviconfetcher.php index 10088dad3..c38706af6 100644 --- a/utility/faviconfetcher.php +++ b/utility/faviconfetcher.php @@ -74,16 +74,19 @@ class FaviconFetcher { $file = $this->getFile($url); - if($file->body !== '') { + /** @noinspection PhpUndefinedFieldInspection */ + if($file->body !== '') { $document = new \DOMDocument(); - @$document->loadHTML($file->body); + /** @noinspection PhpUndefinedFieldInspection */ + @$document->loadHTML($file->body); if($document) { $xpath = new \DOMXpath($document); $elements = $xpath->query("//link[contains(@rel, 'icon')]"); if ($elements->length > 0) { - $iconPath = $elements->item(0)->getAttribute('href'); + /** @noinspection PhpUndefinedMethodInspection */ + $iconPath = $elements->item(0)->getAttribute('href'); $absPath = \SimplePie_Misc::absolutize_url($iconPath, $url); return $absPath; } diff --git a/utility/simplepieapifactory.php b/utility/simplepieapifactory.php index d1fd26111..869cfa762 100644 --- a/utility/simplepieapifactory.php +++ b/utility/simplepieapifactory.php @@ -31,7 +31,7 @@ class SimplePieAPIFactory { * @param null $proxyHost * @param null $proxyPort * @param null $proxyAuth - * @return SimplePie_File a new object + * @return \SimplePie_File a new object */ public function getFile($url, $timeout=10, $redirects=5, $headers=null, $useragent=null, $force_fsockopen=false, |