From 9b6a8f6c875e034e5a0712d6456e69bda5359801 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 onm 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. Signed-off-by: Thomas Hochstein --- serendipity_config.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/serendipity_config.inc.php b/serendipity_config.inc.php index a8fd891a..2b12dccb 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.