aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-09-14 20:24:22 +0200
committerGravatar GitHub <noreply@github.com> 2023-09-14 20:24:22 +0200
commitdb53d2655b1771bd32fe2eb2c042b6b89f981c74 (patch)
tree0f9b4d601c8ecdb93210bb5238993f69a029885d /app
parent36173608832653ecc1dadb4bdd30e7573675b224 (diff)
Allow string in XPath tags (#5653)
fix https://github.com/FreshRSS/FreshRSS/issues/5651
Diffstat (limited to 'app')
-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) {