From d236afeb74f8f8725c9b4ea238105dd631777e3f Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Tue, 27 Dec 2016 21:34:28 -0500 Subject: [PATCH] Always update feed url to avoid useless redirections for future requests --- ChangeLog | 1 + app/handlers/feed.php | 5 +++-- app/helpers/app.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index dac489f..ebef6b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ Version 1.2.0 (unreleased) * Remove automatic software update from the user interface * New API methods (not backward compatible) * Fever API tokens are longer than before +* Always update feed URL to avoid useless redirections for futures requests * Add support for Wallabag service * Add unit tests diff --git a/app/handlers/feed.php b/app/handlers/feed.php index 875f6d1..4fdbdf3 100644 --- a/app/handlers/feed.php +++ b/app/handlers/feed.php @@ -113,9 +113,10 @@ function update_feed($user_id, $feed_id) } else { Model\Feed\update_feed($user_id, $feed_id, array( - 'etag' => $resource->getEtag(), + 'feed_url' => $resource->getUrl(), + 'etag' => $resource->getEtag(), 'last_modified' => $resource->getLastModified(), - 'last_checked' => time(), + 'last_checked' => time(), 'parsing_error' => 0, )); } diff --git a/app/helpers/app.php b/app/helpers/app.php index f2c89b9..0b09bcf 100644 --- a/app/helpers/app.php +++ b/app/helpers/app.php @@ -65,6 +65,6 @@ function write_debug_file() { if (DEBUG_MODE) { $feed_logs = Logger::getMessages(); $db_logs = Database::getInstance('db')->getLogMessages(); - file_put_contents(DEBUG_FILENAME, implode(PHP_EOL, array_merge($feed_logs, $db_logs)), FILE_APPEND|LOCK_EX); + file_put_contents(DEBUG_FILENAME, implode(PHP_EOL, $feed_logs + $db_logs), FILE_APPEND|LOCK_EX); } }