aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Feed.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Models/Feed.php')
-rw-r--r--app/Models/Feed.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/Models/Feed.php b/app/Models/Feed.php
index 80d4e4580..e295804ae 100644
--- a/app/Models/Feed.php
+++ b/app/Models/Feed.php
@@ -723,8 +723,10 @@ class FreshRSS_Feed extends Minz_Model {
}
$item['thumbnail'] = $xPathItemThumbnail == '' ? '' : @$xpath->evaluate('normalize-space(' . $xPathItemThumbnail . ')', $node);
if ($xPathItemCategories != '') {
- $itemCategories = @$xpath->query($xPathItemCategories, $node);
- if ($itemCategories !== false) {
+ $itemCategories = @$xpath->evaluate($xPathItemCategories, $node);
+ if (is_string($itemCategories) && $itemCategories !== '') {
+ $item['tags'] = [$itemCategories];
+ } elseif ($itemCategories instanceof DOMNodeList && $itemCategories->length > 0) {
$item['tags'] = [];
/** @var DOMNode $itemCategory */
foreach ($itemCategories as $itemCategory) {