summaryrefslogtreecommitdiff
path: root/classes/feeds.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-09-08 09:04:15 +0300
committerAndrew Dolgov <[email protected]>2021-09-08 09:04:15 +0300
commit8ed927dbd2b54aaabe6be75f9fcf4145e2c3249a (patch)
treea1b13b4e41c2489d2652e10dcdedd63a10d62c43 /classes/feeds.php
parent78ff7770d164175f4c78f41c787b87c9fe631006 (diff)
OPML: multiple fixes
- remove unused integer indexes when exporting filters as JSON - fix warning when importing filters without rules - properly assign category IDs for category filter rules - fix warning: check if outline attributes like xmlUrl are set before trying to use them - fix warning: don't try to use libxml_disable_entity_loader on PHP 8
Diffstat (limited to 'classes/feeds.php')
-rwxr-xr-xclasses/feeds.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/classes/feeds.php b/classes/feeds.php
index 42673ca95..348c42c9e 100755
--- a/classes/feeds.php
+++ b/classes/feeds.php
@@ -1105,6 +1105,30 @@ class Feeds extends Handler_Protected {
}
}
+ /** $owner_uid defaults to $_SESSION['uid] */
+ static function _find_by_title(string $title, bool $cat = false, int $owner_uid = 0) {
+
+ $res = false;
+
+ if ($cat) {
+ $res = ORM::for_table('ttrss_feed_categories')
+ ->where('owner_uid', $owner_uid ? $owner_uid : $_SESSION['uid'])
+ ->where('title', $title)
+ ->find_one();
+ } else {
+ $res = ORM::for_table('ttrss_feeds')
+ ->where('owner_uid', $owner_uid ? $owner_uid : $_SESSION['uid'])
+ ->where('title', $title)
+ ->find_one();
+ }
+
+ if ($res) {
+ return $res->id;
+ } else {
+ return false;
+ }
+ }
+
static function _get_title($id, bool $cat = false) {
$pdo = Db::pdo();