mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-05-14 18:23:52 -04:00
Replace "keep history" magic value by a constant (#1759)
I think the use of a magic value repeated many times in the code is prone to have some errors made by people not knowing its meaning. Using a constant is a bit more safe. Judging by some comments in the code, I am not the only one.
This commit is contained in:
committed by
Alexandre Alapetite
parent
e3ffc048d7
commit
7642d334f8
@@ -177,9 +177,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
|
||||
|
||||
foreach ($feeds as $feed) {
|
||||
$feed_history = $feed->keepHistory();
|
||||
if ($feed_history == -2) {
|
||||
// TODO: -2 must be a constant!
|
||||
// -2 means we take the default value from configuration
|
||||
if (FreshRSS_Feed::KEEP_HISTORY_DEFAULT === $feed_history) {
|
||||
$feed_history = FreshRSS_Context::$user_conf->keep_history_default;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user