Merge pull request #646 from th-h/thh-positive-limits

Force positive values for fetchLimits.
This commit is contained in:
Garvin Hicking 2019-10-14 13:09:45 +02:00 committed by GitHub
commit f7c20f0e82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.