]> git.wh0rd.org Git - tt-rss.git/commitdiff
update site_url (and title if needed) when changing feed_url in feed editor
authorAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Mon, 10 Aug 2015 12:14:38 +0000 (15:14 +0300)
committerAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Mon, 10 Aug 2015 12:14:38 +0000 (15:14 +0300)
classes/pref/feeds.php

index 01197d92c1e6062b6c6549bcdde29dff4147f9fb..96a234af09dcdaa46720febb14184892a0d97d61 100644 (file)
@@ -991,6 +991,11 @@ class Pref_Feeds extends Handler_Protected {
 
                if (!$batch) {
 
+                       $result = db_query("SELECT feed_url FROM ttrss_feeds WHERE id = " . $feed_id);
+                       $orig_feed_url = db_fetch_result($result, 0, "feed_url");
+
+                       $reset_basic_info = $orig_feed_url != $feed_link;
+
                        $this->dbh->query("UPDATE ttrss_feeds SET
                                $category_qpart
                                title = '$feed_title', feed_url = '$feed_link',
@@ -1008,6 +1013,12 @@ class Pref_Feeds extends Handler_Protected {
                                feed_language = '$feed_language'
                        WHERE id = '$feed_id' AND owner_uid = " . $_SESSION["uid"]);
 
+                       if ($reset_basic_info) {
+                               require_once "rssfuncs.php";
+
+                               set_basic_feed_info($feed_id);
+                       }
+
                        PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_SAVE_FEED,
                                "hook_prefs_save_feed", $feed_id);