mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-19 02:21:30 +00:00
do not rely on feed_id when adding archived feed while unsubscribing
This commit is contained in:
@@ -1712,12 +1712,15 @@ class Pref_Feeds extends Handler_Protected {
|
|||||||
WHERE feed_url = '$feed_url' AND owner_uid = $owner_uid");
|
WHERE feed_url = '$feed_url' AND owner_uid = $owner_uid");
|
||||||
|
|
||||||
if (db_num_rows($result) == 0) {
|
if (db_num_rows($result) == 0) {
|
||||||
|
$result = db_query($link, "SELECT MAX(id) AS id FROM ttrss_archived_feeds");
|
||||||
|
$new_feed_id = (int)db_fetch_result($result, 0, "id") + 1;
|
||||||
|
|
||||||
db_query($link, "INSERT INTO ttrss_archived_feeds
|
db_query($link, "INSERT INTO ttrss_archived_feeds
|
||||||
(id, owner_uid, title, feed_url, site_url)
|
(id, owner_uid, title, feed_url, site_url)
|
||||||
SELECT id, owner_uid, title, feed_url, site_url from ttrss_feeds
|
SELECT $new_feed_id, owner_uid, title, feed_url, site_url from ttrss_feeds
|
||||||
WHERE id = '$id'");
|
WHERE id = '$id'");
|
||||||
|
|
||||||
$archive_id = $id;
|
$archive_id = $new_feed_id;
|
||||||
} else {
|
} else {
|
||||||
$archive_id = db_fetch_result($result, 0, "id");
|
$archive_id = db_fetch_result($result, 0, "id");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user