Make WordPress Core


Ignore:
Timestamp:
07/17/2026 04:36:42 PM (3 months ago)
Author:
desrosj
Message:

Grouped backports to the 6.9 branch.

  • REST API: sub-requests must always use dispatch.
  • REST API: Ensure errors in batch requests propogate.
  • Query: Force authornot_in values to be integers.

Merges [62769], [62770], [62771] to the 6.9 branch.

Props peterwilsoncc, westonruter, xknown, joehoyle, sergeybiryukov, jorbin, johnbillion, desrosj, clorith, ehtis.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/6.9/src/wp-includes/class-wp-query.php

    r61044 r62775  
    24022402
    24032403                if ( ! empty( $query_vars['author__not_in'] ) ) {
    2404                         if ( is_array( $query_vars['author__not_in'] ) ) {
    2405                                 $query_vars['author__not_in'] = array_unique( array_map( 'absint', $query_vars['author__not_in'] ) );
    2406                                 sort( $query_vars['author__not_in'] );
    2407                         }
    2408                         $author__not_in = implode( ',', (array) $query_vars['author__not_in'] );
    2409                         $where         .= " AND {$wpdb->posts}.post_author NOT IN ($author__not_in) ";
     2404                        $author__not_in_id_list = wp_parse_id_list( $query_vars['author__not_in'] );
     2405                        if ( count( $author__not_in_id_list ) > 0 ) {
     2406                                sort( $author__not_in_id_list );
     2407                                $where .= sprintf(
     2408                                        " AND {$wpdb->posts}.post_author NOT IN (%s) ",
     2409                                        implode( ',', $author__not_in_id_list )
     2410                                );
     2411                                /** Update the query var for stable cache key generation in {@see self::generate_cache_key()}. */
     2412                                $query_vars['author__not_in'] = $author__not_in_id_list;
     2413                        }
    24102414                } elseif ( ! empty( $query_vars['author__in'] ) ) {
    24112415                        if ( is_array( $query_vars['author__in'] ) ) {
Note: See TracChangeset for help on using the changeset viewer.