aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/feedController.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2022-07-04 09:53:26 +0200
committerGravatar GitHub <noreply@github.com> 2022-07-04 09:53:26 +0200
commit509c8cae6381ec46af7c8303eb92fda6ce496a4a (patch)
tree653f7f44df842f9d7135decd89467879a0098c50 /app/Controllers/feedController.php
parent57d571230eeb2d3ede57e640b640f17c7a2298a2 (diff)
Dynamic OPML (#4407)
* Dynamic OPML draft #fix https://github.com/FreshRSS/FreshRSS/issues/4191 * Export dynamic OPML http://opml.org/spec2.opml#1629043127000 * Restart with simpler approach * Minor revert * Export dynamic OPML also for single feeds * Special category type for importing dynamic OPML * Parameter for excludeMutedFeeds * Details * More draft * i18n * Fix update * Draft manual import working * Working manual refresh * Draft automatic update * Working Web refresh + fixes * Import/export dynamic OPML settings * Annoying numerous lines in SQL logs * Fix minor JavaScript error * Fix auto adding new columns * Add require * Add missing 🗲 * Missing space * Disable adding new feeds to dynamic categories * Link from import * i18n typo * Improve theme icon function * Fix pink-dark
Diffstat (limited to 'app/Controllers/feedController.php')
-rwxr-xr-xapp/Controllers/feedController.php25
1 files changed, 10 insertions, 15 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index fe5641642..8621cb535 100755
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -67,6 +67,10 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
$cat_id = $cat == null ? FreshRSS_CategoryDAO::DEFAULTCATEGORYID : $cat->id();
$feed = new FreshRSS_Feed($url); //Throws FreshRSS_BadUrl_Exception
+ $title = trim($title);
+ if ($title != '') {
+ $feed->_name($title);
+ }
$feed->_kind($kind);
$feed->_attributes('', $attributes);
$feed->_httpAuth($http_auth);
@@ -92,19 +96,7 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
throw new FreshRSS_FeedNotAdded_Exception($url);
}
- $values = array(
- 'url' => $feed->url(),
- 'kind' => $feed->kind(),
- 'category' => $feed->category(),
- 'name' => $title != '' ? $title : $feed->name(true),
- 'website' => $feed->website(),
- 'description' => $feed->description(),
- 'lastUpdate' => 0,
- 'httpAuth' => $feed->httpAuth(),
- 'attributes' => $feed->attributes(),
- );
-
- $id = $feedDAO->addFeed($values);
+ $id = $feedDAO->addFeedObject($feed);
if (!$id) {
// There was an error in database… we cannot say what here.
throw new FreshRSS_FeedNotAdded_Exception($url);
@@ -469,7 +461,8 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
}
if ($pubSubHubbubEnabled && !$simplePiePush) { //We use push, but have discovered an article by pull!
- $text = 'An article was discovered by pull although we use PubSubHubbub!: Feed ' . $url .
+ $text = 'An article was discovered by pull although we use PubSubHubbub!: Feed ' .
+ SimplePie_Misc::url_remove_credentials($url) .
' GUID ' . $entry->guid();
Minz_Log::warning($text, PSHB_LOG);
Minz_Log::warning($text);
@@ -528,7 +521,8 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
}
}
} elseif ($feed->url() !== $url) { // HTTP 301 Moved Permanently
- Minz_Log::notice('Feed ' . $url . ' moved permanently to ' . $feed->url(false));
+ Minz_Log::notice('Feed ' . SimplePie_Misc::url_remove_credentials($url) .
+ ' moved permanently to ' . SimplePie_Misc::url_remove_credentials($feed->url(false)));
$feedProperties['url'] = $feed->url();
}
@@ -629,6 +623,7 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
$databaseDAO = FreshRSS_Factory::createDatabaseDAO();
$databaseDAO->minorDbMaintenance();
} else {
+ FreshRSS_category_Controller::refreshDynamicOpmls();
list($updated_feeds, $feed, $nb_new_articles) = self::actualizeFeed($id, $url, $force, null, $noCommit, $maxFeeds);
}