From f68d096c3127c15a3e3356f9f4b996615c7fef7c Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 27 Jun 2014 00:03:05 +0000 Subject: [PATCH] Make sure the first number in LIMIT clause in WP_Query::get_posts() is always an integer. fixes #23383. git-svn-id: https://develop.svn.wordpress.org/trunk@28864 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/query.php b/src/wp-includes/query.php index e7e60d5233..e348c1f729 100644 --- a/src/wp-includes/query.php +++ b/src/wp-includes/query.php @@ -2874,7 +2874,7 @@ class WP_Query { $page = 1; if ( empty($q['offset']) ) { - $pgstrt = ($page - 1) * $q['posts_per_page'] . ', '; + $pgstrt = absint( ( $page - 1 ) * $q['posts_per_page'] ) . ', '; } else { // we're ignoring $page and using 'offset' $q['offset'] = absint($q['offset']); $pgstrt = $q['offset'] . ', ';