Skip to content

Commit 77bea11

Browse files
committed
Include 4 6.8-branch commits
Commit list: 01c10003eb6149ec2786ec27fbcdcd819a30a327 5b37e6aff11f4cb278a8265160afb4cda1ae3cf7 d75f025337fdc3b7dab5ba951152c4b7e66532cd b024026e8146803d5246e6cc925426c87ad71a79 See #60
1 parent 83c36c8 commit 77bea11

File tree

8 files changed

+78
-35
lines changed

8 files changed

+78
-35
lines changed

wp-admin/includes/class-wp-debug-data.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -484,19 +484,19 @@ private static function get_wp_server(): array {
484484
$robotstxt_debug = true;
485485

486486
/* translators: %s: robots.txt */
487-
$robotstxt_string = sprintf( __( 'There is a static %s file in your installation folder. WordPress can not dynamicly serve one.' ), 'robots.txt' );
487+
$robotstxt_string = sprintf( __( 'There is a static %s file in your installation folder. Retraceur cannot dynamically serve one.' ), 'robots.txt' );
488488
} elseif ( got_url_rewrite() ) {
489489
// No robots.txt file available and rewrite rules in place, turn debug info to false.
490490
$robotstxt_debug = false;
491491

492492
/* translators: %s: robots.txt */
493-
$robotstxt_string = sprintf( __( 'Your site is using the dynamic %s file which is generated by WordPress.' ), 'robots.txt' );
493+
$robotstxt_string = sprintf( __( 'Your site is using the dynamic %s file which is generated by Retraceur.' ), 'robots.txt' );
494494
} else {
495495
// No robots.txt file, but without rewrite rules WP can't serve one.
496496
$robotstxt_debug = true;
497497

498498
/* translators: %s: robots.txt */
499-
$robotstxt_string = sprintf( __( 'WordPress can not dynamicly serve a %s file due to a lack of rewrite rule support' ), 'robots.txt' );
499+
$robotstxt_string = sprintf( __( 'Retraceur cannot dynamically serve a %s file due to a lack of rewrite rule support' ), 'robots.txt' );
500500

501501
}
502502
$fields['static_robotstxt_file'] = array(

wp-admin/includes/misc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ function show_message( $message ) {
427427
* @since WP 2.8.0
428428
*
429429
* @param string $content
430-
* @return array
430+
* @return string[] Array of function names.
431431
*/
432432
function wp_doc_link_parse( $content ) {
433433
if ( ! is_string( $content ) || empty( $content ) ) {

wp-admin/includes/post.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,13 @@ function edit_post( $post_data = null ) {
483483
*
484484
* @param array|null $post_data Optional. The array of post data to process.
485485
* Defaults to the `$_POST` superglobal.
486-
* @return array
486+
* @return array {
487+
* An array of updated, skipped, and locked post IDs.
488+
*
489+
* @type int[] $updated An array of updated post IDs.
490+
* @type int[] $skipped An array of skipped post IDs.
491+
* @type int[] $locked An array of locked post IDs.
492+
* }
487493
*/
488494
function bulk_edit_posts( $post_data = null ) {
489495
global $wpdb;
@@ -1192,7 +1198,7 @@ function get_available_post_statuses( $type = 'post' ) {
11921198
*
11931199
* @param array|false $q Optional. Array of query variables to use to build the query.
11941200
* Defaults to the `$_GET` superglobal.
1195-
* @return array
1201+
* @return string[] An array of all the statuses for the queried post type.
11961202
*/
11971203
function wp_edit_posts_query( $q = false ) {
11981204
if ( false === $q ) {
@@ -1364,7 +1370,12 @@ function wp_edit_attachments_query_vars( $q = false ) {
13641370
*
13651371
* @param array|false $q Optional. Array of query variables to use to build the query.
13661372
* Defaults to the `$_GET` superglobal.
1367-
* @return array
1373+
* @return array {
1374+
* Array containing the post mime types and available post mime types.
1375+
*
1376+
* @type array[] $post_mime_types Post mime types.
1377+
* @type string[] $avail_post_mime_types Available post mime types.
1378+
* }
13681379
*/
13691380
function wp_edit_attachments_query( $q = false ) {
13701381
wp( wp_edit_attachments_query_vars( $q ) );

wp-admin/includes/user.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ function get_users_drafts( $user_id ) {
313313
$query = $wpdb->prepare( "SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'draft' AND post_author = %d ORDER BY post_modified DESC", $user_id );
314314

315315
/**
316-
* Filters the user's drafts query string.
316+
* Filters the SQL query string for the user's drafts query.
317317
*
318318
* @since WP 2.0.0
319319
*

wp-includes/pluggable.php

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2283,7 +2283,6 @@ function wp_hash_password(
22832283
* @since WP 2.5.0
22842284
* @since WP 6.8.0 Passwords in WordPress are now hashed with bcrypt by default. A
22852285
* password that wasn't hashed with bcrypt will be checked with phpass.
2286-
* Passwords hashed with md5 are no longer supported.
22872286
*
22882287
* @global PasswordHash $wp_hasher phpass object. Used as a fallback for verifying
22892288
* passwords that were hashed with phpass.
@@ -2301,30 +2300,14 @@ function wp_check_password(
23012300
) {
23022301
global $wp_hasher;
23032302

2304-
$check = false;
2305-
2306-
// If the hash is still md5 or otherwise truncated then invalidate it.
23072303
if ( strlen( $hash ) <= 32 ) {
2308-
/**
2309-
* Filters whether the plaintext password matches the hashed password.
2310-
*
2311-
* @since WP 2.5.0
2312-
* @since WP 6.8.0 Passwords are now hashed with bcrypt by default.
2313-
* Old passwords may still be hashed with phpass.
2314-
*
2315-
* @param bool $check Whether the passwords match.
2316-
* @param string $password The plaintext password.
2317-
* @param string $hash The hashed password.
2318-
* @param string|int $user_id Optional ID of a user associated with the password.
2319-
* Can be empty.
2320-
*/
2321-
return apply_filters( 'check_password', $check, $password, $hash, $user_id );
2322-
}
2323-
2324-
if ( ! empty( $wp_hasher ) ) {
2304+
// Check the hash using md5 regardless of the current hashing mechanism.
2305+
$check = hash_equals( $hash, md5( $password ) );
2306+
} elseif ( ! empty( $wp_hasher ) ) {
23252307
// Check the password using the overridden hasher.
23262308
$check = $wp_hasher->CheckPassword( $password, $hash );
23272309
} elseif ( strlen( $password ) > 4096 ) {
2310+
// Passwords longer than 4096 characters are not supported.
23282311
$check = false;
23292312
} elseif ( str_starts_with( $hash, '$wp' ) ) {
23302313
// Check the password using the current prefixed hash.
@@ -2339,7 +2322,19 @@ function wp_check_password(
23392322
$check = password_verify( $password, $hash );
23402323
}
23412324

2342-
/** This filter is documented in wp-includes/pluggable.php */
2325+
/**
2326+
* Filters whether the plaintext password matches the hashed password.
2327+
*
2328+
* @since WP 2.5.0
2329+
* @since WP 6.8.0 Passwords are now hashed with bcrypt by default.
2330+
* Old passwords may still be hashed with phpass or md5.
2331+
*
2332+
* @param bool $check Whether the passwords match.
2333+
* @param string $password The plaintext password.
2334+
* @param string $hash The hashed password.
2335+
* @param string|int $user_id Optional ID of a user associated with the password.
2336+
* Can be empty.
2337+
*/
23432338
return apply_filters( 'check_password', $check, $password, $hash, $user_id );
23442339
}
23452340
endif;

wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ public function get_items_permissions_check( $request ) {
259259
* Retrieves all users.
260260
*
261261
* @since WP 4.7.0
262+
* @since WP 6.8.0 Added support for the search_columns query param.
262263
*
263264
* @param WP_REST_Request $request Full details about the request.
264265
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
@@ -333,6 +334,27 @@ public function get_items( $request ) {
333334
if ( ! current_user_can( 'list_users' ) ) {
334335
$prepared_args['search_columns'] = array( 'ID', 'user_login', 'user_nicename', 'display_name' );
335336
}
337+
$search_columns = $request->get_param( 'search_columns' );
338+
$valid_columns = isset( $prepared_args['search_columns'] )
339+
? $prepared_args['search_columns']
340+
: array( 'ID', 'user_login', 'user_nicename', 'user_email', 'display_name' );
341+
$search_columns_mapping = array(
342+
'id' => 'ID',
343+
'username' => 'user_login',
344+
'slug' => 'user_nicename',
345+
'email' => 'user_email',
346+
'name' => 'display_name',
347+
);
348+
$search_columns = array_map(
349+
static function ( $column ) use ( $search_columns_mapping ) {
350+
return $search_columns_mapping[ $column ];
351+
},
352+
$search_columns
353+
);
354+
$search_columns = array_intersect( $search_columns, $valid_columns );
355+
if ( ! empty( $search_columns ) ) {
356+
$prepared_args['search_columns'] = $search_columns;
357+
}
336358
$prepared_args['search'] = '*' . $prepared_args['search'] . '*';
337359
}
338360
/**
@@ -1613,6 +1635,16 @@ public function get_collection_params() {
16131635
),
16141636
);
16151637

1638+
$query_params['search_columns'] = array(
1639+
'default' => array(),
1640+
'description' => __( 'Array of column names to be searched.' ),
1641+
'type' => 'array',
1642+
'items' => array(
1643+
'enum' => array( 'email', 'name', 'id', 'username', 'slug' ),
1644+
'type' => 'string',
1645+
),
1646+
);
1647+
16161648
/**
16171649
* Filters REST API collection parameters for the users controller.
16181650
*

wp-includes/script-loader.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,7 +1716,7 @@ function wp_style_loader_src( $src, $handle ) {
17161716
*
17171717
* @global bool $concatenate_scripts
17181718
*
1719-
* @return array
1719+
* @return string[] Handles of the scripts that were printed.
17201720
*/
17211721
function print_head_scripts() {
17221722
global $concatenate_scripts;
@@ -1755,7 +1755,7 @@ function print_head_scripts() {
17551755
* @global WP_Scripts $wp_scripts
17561756
* @global bool $concatenate_scripts
17571757
*
1758-
* @return array
1758+
* @return string[] Handles of the scripts that were printed.
17591759
*/
17601760
function print_footer_scripts() {
17611761
global $wp_scripts, $concatenate_scripts;
@@ -1836,7 +1836,7 @@ function _print_scripts() {
18361836
*
18371837
* @global WP_Scripts $wp_scripts
18381838
*
1839-
* @return array
1839+
* @return string[] Handles of the scripts that were printed.
18401840
*/
18411841
function wp_print_head_scripts() {
18421842
global $wp_scripts;
@@ -1901,7 +1901,7 @@ function wp_enqueue_scripts() {
19011901
*
19021902
* @global bool $concatenate_scripts
19031903
*
1904-
* @return array
1904+
* @return string[] Handles of the styles that were printed.
19051905
*/
19061906
function print_admin_styles() {
19071907
global $concatenate_scripts;

wp-includes/update.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,12 @@ function retraceur_is_updater_enabled() {
819819
*
820820
* @since WP 3.3.0
821821
*
822-
* @return array
822+
* @return array {
823+
* Fetched update data.
824+
*
825+
* @type int[] $counts An array of counts for available plugin, theme, and WordPress updates.
826+
* @type string $update_title Titles of available updates.
827+
* }
823828
*/
824829
function wp_get_update_data() {
825830
$counts = array(

0 commit comments

Comments
 (0)