Merge pull request from th-h/thh-limit

Set empty limit to "" in serendipity_fetchEntries.
This commit is contained in:
Thomas Hochstein 2020-03-21 18:01:57 +01:00 committed by GitHub
commit 599aeef3b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

@ -1,6 +1,8 @@
Version 2.4-alpha1 ()
------------------------------------------------------------------------
* Fix: Force empty limit to "" in serendipity_fetchEntries().
* Fix: Escape version string in update notifier to avoid XSS.
* Fix: Prevent renaming a ML object into an existing file,

@ -435,6 +435,15 @@ function &serendipity_fetchEntries($range = null, $full = true, $limit = '', $fe
}
$limit = serendipity_db_limit_sql($limit);
} else {
# if $limit was empty(), no limit was set;
# but empty() may also mean FALSE, "" or 0,
# so set it to "" to remove the LIMIT
# statement completely; should catch errors
# with a limit of 0 and some database drivers
# see <https://github.com/s9y/Serendipity/issues/636>
$limit = '';
}
$query = "SELECT $select_key