From b33cc43b7bea9bbce9f94e923a1f7c13e4ef3f68 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 30 Aug 2022 15:18:08 +0000 Subject: [PATCH] General: Ensure bookmark query limits are numeric. Props paulkevan, xknown. Merges [53959] to the 6.0 branch. git-svn-id: https://develop.svn.wordpress.org/branches/6.0@53962 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/bookmark.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/bookmark.php b/src/wp-includes/bookmark.php index f46ae93b54..cee56d7d21 100644 --- a/src/wp-includes/bookmark.php +++ b/src/wp-includes/bookmark.php @@ -307,7 +307,7 @@ function get_bookmarks( $args = '' ) { $query .= " $exclusions $inclusions $search"; $query .= " ORDER BY $orderby $order"; if ( -1 != $parsed_args['limit'] ) { - $query .= ' LIMIT ' . $parsed_args['limit']; + $query .= ' LIMIT ' . absint( $parsed_args['limit'] ); } $results = $wpdb->get_results( $query );