Make WordPress Core


Ignore:
Timestamp:
09/17/2026 09:15:04 PM (6 hours ago)
Author:
desrosj
Message:

Security: Backport the WordPress 7.1.1 security fixes to the 4.7 branch.

  • Posts, Post Types: Reject a supplied post ID on the create path in _wp_translate_postdata().
  • XML-RPC: Reject writes to internal-only builtin post types.
  • Administration: Add authorization check to wp_ajax_sample_permalink().
  • Customize: Improve header_image_data theme mod sanitization.
  • Plugins: Require network plugin authority to Ajax-activate a network-only plugin.
  • Formatting: Prevent wpautop() moving a paragraph into an attribute of a blockquote.

Merges r63657, r63659, r63660, r63665, r63669, r63672 to the 4.7 branch.

Props xknown, westonruter, jorbin, vortfu, batmoo, davidbinda, jeremyfelt, johnbillion, peterwilsoncc, lancewillett, jonsurrell, dmsnell, whyisjake, buffer1024, joehoyle, rafiem.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/src/wp-includes/class-wp-xmlrpc-server.php

    r49399 r63715  
    13311331                        return new IXR_Error( 403, __( 'Invalid post type.' ) );
    13321332
     1333                // Reject writes to internal-only builtin post types (e.g. customize_changeset)
     1334                // whose intended write path is a dedicated helper, not a generic post API.
     1335                $is_internal_only = (
     1336                        empty( $post_type->public )
     1337                        && empty( $post_type->show_in_rest )
     1338                        && ! empty( $post_type->_builtin )
     1339                );
     1340
     1341                /**
     1342                 * Filters whether a post type accepts writes via XML-RPC.
     1343                 *
     1344                 * Defaults to false for internal-only builtin post types (public=false,
     1345                 * show_in_rest=false, _builtin=true), such as customize_changeset, whose
     1346                 * writes are meant to flow through dedicated helpers. Return true to opt
     1347                 * a post type back in.
     1348                 *
     1349                 * @since 7.1.1
     1350                 *
     1351                 * @param bool         $allowed   Whether the post type accepts XML-RPC writes.
     1352                 * @param WP_Post_Type $post_type The post type object.
     1353                 */
     1354                $allowed = apply_filters( 'xmlrpc_allow_post_type_writes', ! $is_internal_only, $post_type );
     1355
     1356                if ( ! $allowed ) {
     1357                        return new IXR_Error( 403, __( 'Sorry, this post type is not supported over XML-RPC.' ) );
     1358                }
     1359
    13331360                $update = ! empty( $post_data['ID'] );
    13341361
Note: See TracChangeset for help on using the changeset viewer.