From 66494fdbe3f0e60390b798126fc6375f04230aef Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Sun, 13 Oct 2019 17:22:59 +0200 Subject: [PATCH] Force positive values for fetchLimits. The number of entries shown on the title page and in the feed has to be at least "1", as s9y can't cope with "0" or negative values (and it shouldn't). May be related to #636. Backported from master. Signed-off-by: Thomas Hochstein --- docs/NEWS | 5 +++++ serendipity_config.inc.php | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/NEWS b/docs/NEWS index 6cf417c0..1ece4d22 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -10,6 +10,11 @@ Version 2.3.3-beta1 () published blog entries and ability to prepend a mail body. Also fixes missing "keep strip tags" configuration option + * Fix: Force positive limits for number of entries shown on + title page and in RSS feed. s9y doesn't work with 0 or + negative numbers, so force our default (15) in this case, + (#646) + Version 2.3.2 (October 16th, 2019) ------------------------------------------------------------------------ diff --git a/serendipity_config.inc.php b/serendipity_config.inc.php index 89e492f5..14c80235 100644 --- a/serendipity_config.inc.php +++ b/serendipity_config.inc.php @@ -376,9 +376,11 @@ if (isset($_SESSION['serendipityAuthorid'])) { $serendipity['lang'] = serendipity_getPostAuthSessionLanguage(); } -// Ensure that these limits do not contain strings +// Ensure that these limits do not contain strings and have positive values $serendipity['fetchLimit'] = (int)$serendipity['fetchLimit']; +if ($serendipity['fetchLimit'] < 1) $serendipity['fetchLimit'] = 1; $serendipity['RSSfetchLimit'] = (int)$serendipity['RSSfetchLimit']; +if ($serendipity['RSSfetchLimit'] < 1) $serendipity['RSSfetchLimit'] = 1; // Try to fix some path settings. It seems common users have this setting wrong // when s9y is installed into the root directory, especially 0.7.1 upgrade users.