Fix XPath context for tags (#4246)

#fix https://github.com/FreshRSS/FreshRSS/issues/4245
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/4220
This commit is contained in:
Alexandre Alapetite
2022-03-02 17:44:52 +01:00
committed by GitHub
parent 467ca9d0de
commit fd945ffb93
5 changed files with 7 additions and 4 deletions

View File

@@ -2,6 +2,9 @@
## 2022-0X-XX FreshRSS 1.20.0-dev
* Features
* New Web scraping feature *HTML+XPath* for Web pages without any RSS/ATOM feed [#4220](https://github.com/FreshRSS/FreshRSS/pull/4220)
## 2022-02-04 FreshRSS 1.19.2

View File

@@ -605,7 +605,7 @@ class FreshRSS_Feed extends Minz_Model {
$item['timestamp'] = $xPathItemTimestamp == '' ? '' : @$xpath->evaluate('normalize-space(' . $xPathItemTimestamp . ')', $node);
$item['thumbnail'] = $xPathItemThumbnail == '' ? '' : @$xpath->evaluate('normalize-space(' . $xPathItemThumbnail . ')', $node);
if ($xPathItemCategories != '') {
$itemCategories = @$xpath->query($xPathItemCategories);
$itemCategories = @$xpath->query($xPathItemCategories, $node);
if ($itemCategories) {
foreach ($itemCategories as $itemCategory) {
$item['categories'][] = $itemCategory->textContent;

View File

@@ -16,7 +16,7 @@ ENGINE = INNODB;
CREATE TABLE IF NOT EXISTS `_feed` (
`id` SMALLINT NOT NULL AUTO_INCREMENT, -- v0.7
`url` VARCHAR(511) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
`kind` SMALLINT DEFAULT 0, -- 0.20.0
`kind` SMALLINT DEFAULT 0, -- 1.20.0
`category` SMALLINT DEFAULT 0, -- v0.7
`name` VARCHAR(191) NOT NULL,
`website` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_bin,

View File

@@ -13,7 +13,7 @@ CREATE TABLE IF NOT EXISTS `_category` (
CREATE TABLE IF NOT EXISTS `_feed` (
"id" SERIAL PRIMARY KEY,
"url" VARCHAR(511) UNIQUE NOT NULL,
"kind" SMALLINT DEFAULT 0, -- 0.20.0
"kind" SMALLINT DEFAULT 0, -- 1.20.0
"category" SMALLINT DEFAULT 0,
"name" VARCHAR(255) NOT NULL,
"website" VARCHAR(255),

View File

@@ -14,7 +14,7 @@ CREATE TABLE IF NOT EXISTS `category` (
CREATE TABLE IF NOT EXISTS `feed` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
`url` VARCHAR(511) NOT NULL,
`kind` SMALLINT DEFAULT 0, -- 0.20.0
`kind` SMALLINT DEFAULT 0, -- 1.20.0
`category` SMALLINT DEFAULT 0,
`name` VARCHAR(255) NOT NULL,
`website` VARCHAR(255),