1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 01:46:00 +00:00

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
This commit is contained in:
Andrew Dolgov
2021-09-08 09:04:15 +03:00
parent 78ff7770d1
commit 8ed927dbd2
3 changed files with 66 additions and 13 deletions

View File

@@ -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();