Make WordPress Core


Ignore:
Timestamp:
08/06/2026 07:38:52 PM (2 months ago)
Author:
desrosj
Message:

Security: Backport the WordPress 7.0.3 security fixes to the 5.9 branch.

  • Users: Ensure a proper email address is used before sending email confirmations.
  • Formatting: Prevent stack overflow in safecss_filter_attr.
  • Multisite: Enforce the active signup policy for existing users.
  • HTTP API: Improve compliance with IPv4 Special-Purpose Address Space.
  • Users: Prevent Usernames from mangling HTML
  • Canonical: Only redirect for publicly viewable post types.
  • Administration: When wp_is_large_user_count(), ensure that the post author is always added to author dropdown.
  • Editor: Fix output for post date.

Merges [63060],[63061],[63062],[63063],[63064],[63065],[63067] to the 5.9 branch.

Props xknown, westonruter, jeremyfelt, peterwilsoncc, paulkevan, lucasbustamante, jorbin, desrosj, vortfu, dmsnell, johnbillion, ehtis, batmoo, lancewillett, jonsurrell, isabel_brison, bernhard-reiter, tyxla, aduth.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/6.0/src/wp-includes/canonical.php

    r53043 r63100  
    919919
    920920        if ( get_query_var( 'name' ) ) {
     921                $publicly_viewable_post_types = array_filter( get_post_types( array( 'exclude_from_search' => false ) ), 'is_post_type_viewable' );
     922
    921923                /**
    922924                 * Filters whether to perform a strict guess for a 404 redirect.
    … …  
    939941                if ( get_query_var( 'post_type' ) ) {
    940942                        if ( is_array( get_query_var( 'post_type' ) ) ) {
    941                                 // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare
    942                                 $where .= " AND post_type IN ('" . join( "', '", esc_sql( get_query_var( 'post_type' ) ) ) . "')";
     943                                $post_types = array_intersect( get_query_var( 'post_type' ), $publicly_viewable_post_types );
     944                                if ( empty( $post_types ) ) {
     945                                        return false;
     946                                }
     947                                $where .= " AND post_type IN ('" . implode( "', '", esc_sql( $post_types ) ) . "')";
    943948                        } else {
     949                                if ( ! in_array( get_query_var( 'post_type' ), $publicly_viewable_post_types, true ) ) {
     950                                        return false;
     951                                }
    944952                                $where .= $wpdb->prepare( ' AND post_type = %s', get_query_var( 'post_type' ) );
    945953                        }
    946954                } else {
    947                         $where .= " AND post_type IN ('" . implode( "', '", get_post_types( array( 'public' => true ) ) ) . "')";
     955                        $where .= " AND post_type IN ('" . implode( "', '", esc_sql( $publicly_viewable_post_types ) ) . "')";
    948956                }
    949957
Note: See TracChangeset for help on using the changeset viewer.