From de00a095387499cdb5c8eb9c0ab721d67bd0b3fa Mon Sep 17 00:00:00 2001
From: wn_
Date: Tue, 26 Mar 2024 16:38:05 +0000
Subject: Make implicit nullable parameters explicitly nullable.
This is to address a deprecation planned for PHP 8.4.
https://wiki.php.net/rfc/deprecate-implicitly-nullable-types
---
classes/Feeds.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'classes/Feeds.php')
diff --git a/classes/Feeds.php b/classes/Feeds.php
index 88128cc48..4d4ca3240 100644
--- a/classes/Feeds.php
+++ b/classes/Feeds.php
@@ -2127,7 +2127,7 @@ class Feeds extends Handler_Protected {
$cat->delete();
}
- static function _add_cat(string $title, int $owner_uid, int $parent_cat = null, int $order_id = 0): bool {
+ static function _add_cat(string $title, int $owner_uid, ?int $parent_cat = null, int $order_id = 0): bool {
$cat = ORM::for_table('ttrss_feed_categories')
->where('owner_uid', $owner_uid)
--
cgit v1.2.3-54-g00ecf
From 7a5ea2a2b9ea9e1d9ff5134d626c9a0c4a905e0e Mon Sep 17 00:00:00 2001
From: wn_
Date: Wed, 8 May 2024 23:59:25 +0000
Subject: Check 'head' and 'body' when searching HTML for feed links.
YouTube, for some reason, puts theirs in 'body'.
---
classes/Feeds.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'classes/Feeds.php')
diff --git a/classes/Feeds.php b/classes/Feeds.php
index 4d4ca3240..41351fbde 100644
--- a/classes/Feeds.php
+++ b/classes/Feeds.php
@@ -2097,8 +2097,8 @@ class Feeds extends Handler_Protected {
$doc = new DOMDocument();
if (@$doc->loadHTML($content)) {
$xpath = new DOMXPath($doc);
- $entries = $xpath->query('/html/head/link[@rel="alternate" and '.
- '(contains(@type,"rss") or contains(@type,"atom"))]|/html/head/link[@rel="feed"]');
+ $entries = $xpath->query('/html/*[self::head or self::body]/link[@rel="alternate" and '.
+ '(contains(@type,"rss") or contains(@type,"atom"))]|/html/*[self::head or self::body]/link[@rel="feed"]');
foreach ($entries as $entry) {
if ($entry->hasAttribute('href')) {
--
cgit v1.2.3-54-g00ecf
From 5e7713a65818154470c2afab7798ebf65bacadc3 Mon Sep 17 00:00:00 2001
From: wn_
Date: Thu, 16 May 2024 15:48:21 +0000
Subject: Add option to debug feeds in 'Feeds with update errors' dialog.
Also, prevent opening that dialog from modifying the URL.
---
classes/Feeds.php | 4 ++--
js/CommonDialogs.js | 24 ++++++++++++++++++++++++
2 files changed, 26 insertions(+), 2 deletions(-)
(limited to 'classes/Feeds.php')
diff --git a/classes/Feeds.php b/classes/Feeds.php
index 41351fbde..64674b2d2 100644
--- a/classes/Feeds.php
+++ b/classes/Feeds.php
@@ -453,7 +453,7 @@ class Feeds extends Handler_Protected {
if ($num_errors > 0) {
$reply['content'] .= "
";
- $reply['content'] .= "" .
+ $reply['content'] .= "" .
__('Some feeds have update errors (click for details)') . "";
}
$reply['content'] .= "
";
@@ -603,7 +603,7 @@ class Feeds extends Handler_Protected {
if ($num_errors > 0) {
$reply['headlines']['content'] .= "
";
- $reply['headlines']['content'] .= "".
+ $reply['headlines']['content'] .= "".
__('Some feeds have update errors (click for details)')."";
}
$reply['headlines']['content'] .= "";
diff --git a/js/CommonDialogs.js b/js/CommonDialogs.js
index 989a61539..f666eda36 100644
--- a/js/CommonDialogs.js
+++ b/js/CommonDialogs.js
@@ -251,6 +251,27 @@ const CommonDialogs = {
alert(__("No feeds selected."));
}
},
+ debugSelected: function() {
+ const sel_rows = this.getSelectedFeeds();
+
+ if (sel_rows.length > 0) {
+ if (confirm(__("Debug selected feeds?"))) {
+ Notify.progress("Opening debugger for selected feeds...", true);
+
+ for (let i = 0; i < sel_rows.length; i++) {
+ /* global __csrf_token */
+ App.postOpenWindow("backend.php", {
+ op: "Feeds",
+ method: "updatedebugger",
+ feed_id: sel_rows[i],
+ csrf_token: __csrf_token,
+ });
+ }
+ }
+ } else {
+ alert(__("No feeds selected."));
+ }
+ },
content: `
@@ -290,6 +311,9 @@ const CommonDialogs = {
+
--
cgit v1.2.3-54-g00ecf