Make WordPress Core

Changeset 53971


Ignore:
Timestamp:
08/30/2022 03:38:30 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Grouped backports to the 5.2 branch.

  • Posts, Post Types: Escape output within the_meta().
  • General: Ensure bookmark query limits are numeric.
  • Plugins: Escape output in error messages.
  • Build/Test Tools: Allow the PHPCS plugin in Composer configuration.

Merges [52412,53958-53960] to the 5.2 branch.
Props tykoted, martinkrcho, xknown, dd32, peterwilsoncc, paulkevan, timothyblynjacobs.

Location:
branches/5.2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/5.2

  • branches/5.2/composer.json

    r51846 r53971  
    1616                "yoast/phpunit-polyfills": "^1.0.1"
    1717        },
     18        "config": {
     19                "allow-plugins": {
     20                        "dealerdirect/phpcodesniffer-composer-installer": true
     21                }
     22        },
    1823        "scripts": {
    1924                "format": "phpcbf --standard=phpcs.xml.dist --report-summary --report-source",
  • branches/5.2/src/wp-admin/plugins.php

    r49514 r53971  
    487487                        __( 'The plugin %1$s has been <strong>deactivated</strong> due to an error: %2$s' ),
    488488                        '<code>' . esc_html( $plugin_file ) . '</code>',
    489                         $error->get_error_message()
     489                        esc_html( $error->get_error_message() )
    490490                );
    491491                echo '</p></div>';
     
    540540        if ( is_wp_error( $delete_result ) ) :
    541541                ?>
    542                 <div id="message" class="error notice is-dismissible"><p><?php printf( __( 'Plugin could not be deleted due to an error: %s' ), $delete_result->get_error_message() ); ?></p></div>
     542                <div id="message" class="error notice is-dismissible"><p><?php printf( __( 'Plugin could not be deleted due to an error: %s' ), esc_html( $delete_result->get_error_message() ) ); ?></p></div>
    543543                <?php else : ?>
    544544                <div id="message" class="updated notice is-dismissible">
  • branches/5.2/src/wp-includes/bookmark.php

    r44546 r53971  
    293293        $query .= " ORDER BY $orderby $order";
    294294        if ( $r['limit'] != -1 ) {
    295                 $query .= ' LIMIT ' . $r['limit'];
     295                $query .= ' LIMIT ' . absint( $r['limit'] );
    296296        }
    297297
  • branches/5.2/src/wp-includes/post-template.php

    r45937 r53971  
    10761076 * @since 1.2.0
    10771077 *
    1078  * @internal This will probably change at some point...
     1078 * @deprecated 6.0.2 Use get_post_meta() to retrieve post meta and render manually.
    10791079 */
    10801080function the_meta() {
     1081        _deprecated_function( __FUNCTION__, '6.0.2', 'get_post_meta()' );
    10811082        if ( $keys = get_post_custom_keys() ) {
    10821083                $li_html = '';
     
    10931094                                "<li><span class='post-meta-key'>%s</span> %s</li>\n",
    10941095                                /* translators: %s: Post custom field name */
    1095                                 sprintf( _x( '%s:', 'Post custom field name' ), $key ),
    1096                                 $value
     1096                                esc_html( sprintf( _x( '%s:', 'Post custom field name' ), $key ) ),
     1097                                esc_html( $value )
    10971098                        );
    10981099
Note: See TracChangeset for help on using the changeset viewer.