diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:57:26 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:57:26 +0000 |
commit | 30883c26bdceb9eaf32c8d4a1b0c1bce223b5226 (patch) | |
tree | 39a02e2aeb21ab5b7923c6f5757d66d55b708912 /wp-includes/class-wp-network-query.php | |
parent | Adding upstream version 6.4.3+dfsg1. (diff) | |
download | wordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.tar.xz wordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.zip |
Adding upstream version 6.5+dfsg1.upstream/6.5+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wp-includes/class-wp-network-query.php')
-rw-r--r-- | wp-includes/class-wp-network-query.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/wp-includes/class-wp-network-query.php b/wp-includes/class-wp-network-query.php index 7199ec0..27ab483 100644 --- a/wp-includes/class-wp-network-query.php +++ b/wp-includes/class-wp-network-query.php @@ -145,7 +145,7 @@ class WP_Network_Query { * * @since 4.6.0 * - * @param string|array $query WP_Network_Query arguments. See WP_Network_Query::__construct() + * @param string|array $query WP_Network_Query arguments. See WP_Network_Query::__construct() for accepted arguments. */ public function parse_query( $query = '' ) { if ( empty( $query ) ) { @@ -269,7 +269,7 @@ class WP_Network_Query { } if ( $this->found_networks && $this->query_vars['number'] ) { - $this->max_num_pages = ceil( $this->found_networks / $this->query_vars['number'] ); + $this->max_num_pages = (int) ceil( $this->found_networks / $this->query_vars['number'] ); } // If querying for a count only, there's nothing more to do. @@ -481,14 +481,14 @@ class WP_Network_Query { $this->sql_clauses['orderby'] = $orderby; $this->sql_clauses['limits'] = $limits; - $this->request = " - {$this->sql_clauses['select']} - {$this->sql_clauses['from']} - {$where} - {$this->sql_clauses['groupby']} - {$this->sql_clauses['orderby']} - {$this->sql_clauses['limits']} - "; + // Beginning of the string is on a new line to prevent leading whitespace. See https://core.trac.wordpress.org/ticket/56841. + $this->request = + "{$this->sql_clauses['select']} + {$this->sql_clauses['from']} + {$where} + {$this->sql_clauses['groupby']} + {$this->sql_clauses['orderby']} + {$this->sql_clauses['limits']}"; if ( $this->query_vars['count'] ) { return (int) $wpdb->get_var( $this->request ); |