diff options
Diffstat (limited to 'src/wp-includes')
59 files changed, 670 insertions, 761 deletions
diff --git a/src/wp-includes/author-template.php b/src/wp-includes/author-template.php index 184d7d0f38..a48a6d3e6e 100644 --- a/src/wp-includes/author-template.php +++ b/src/wp-includes/author-template.php @@ -286,7 +286,7 @@ function get_the_author_posts() { if ( ! $post ) { return 0; } - return count_user_posts( $post->post_author, $post->post_type ); + return (int) count_user_posts( $post->post_author, $post->post_type ); } /** diff --git a/src/wp-includes/block-template-utils.php b/src/wp-includes/block-template-utils.php index faea7d5e83..718eb31e33 100644 --- a/src/wp-includes/block-template-utils.php +++ b/src/wp-includes/block-template-utils.php @@ -344,11 +344,8 @@ function _get_block_template_file( $template_type, $slug ) { return _add_block_template_part_area_info( $new_template_item ); } - if ( 'wp_template' === $template_type ) { - return _add_block_template_info( $new_template_item ); - } - - return $new_template_item; + // If it's not a `wp_template_part`, it must be a `wp_template`. + return _add_block_template_info( $new_template_item ); } } @@ -440,7 +437,7 @@ function _get_block_templates_files( $template_type, $query = array() ) { if ( 'wp_template_part' === $template_type ) { $candidate = _add_block_template_part_area_info( $new_template_item ); - if ( ! isset( $area ) || ( isset( $area ) && $area === $candidate['area'] ) ) { + if ( ! isset( $area ) || $area === $candidate['area'] ) { $template_files[ $template_slug ] = $candidate; } } diff --git a/src/wp-includes/block-template.php b/src/wp-includes/block-template.php index affae1c09a..eecbe2d61d 100644 --- a/src/wp-includes/block-template.php +++ b/src/wp-includes/block-template.php @@ -253,7 +253,7 @@ function get_the_block_template_html() { if ( is_user_logged_in() ) { return '<h1>' . esc_html__( 'No matching template found' ) . '</h1>'; } - return; + return ''; } $content = $wp_embed->run_shortcode( $_wp_current_template_content ); diff --git a/src/wp-includes/blocks.php b/src/wp-includes/blocks.php index 838cd84a19..56410779fe 100644 --- a/src/wp-includes/blocks.php +++ b/src/wp-includes/blocks.php @@ -328,8 +328,9 @@ function register_block_style_handle( $metadata, $field_name, $index = 0 ) { $style_path_norm = wp_normalize_path( realpath( dirname( $metadata['file'] ) . '/' . $style_path ) ); $style_uri = get_block_asset_url( $style_path_norm ); - $version = ! $is_core_block && isset( $metadata['version'] ) ? $metadata['version'] : false; - $result = wp_register_style( + $block_version = ! $is_core_block && isset( $metadata['version'] ) ? $metadata['version'] : false; + $version = $style_path_norm && defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? filemtime( $style_path_norm ) : $block_version; + $result = wp_register_style( $style_handle_name, $style_uri, array(), @@ -2403,11 +2404,32 @@ function parse_blocks( $content ) { * @return string Updated post content. */ function do_blocks( $content ) { - $blocks = parse_blocks( $content ); - $output = ''; + $blocks = parse_blocks( $content ); + $top_level_block_count = count( $blocks ); + $output = ''; - foreach ( $blocks as $block ) { - $output .= render_block( $block ); + /** + * Parsed blocks consist of a list of top-level blocks. Those top-level + * blocks may themselves contain nested inner blocks. However, every + * top-level block is rendered independently, meaning there are no data + * dependencies between them. + * + * Ideally, therefore, the parser would only need to parse one complete + * top-level block at a time, render it, and move on. Unfortunately, this + * is not possible with {@see \parse_blocks()} because it must parse the + * entire given document at once. + * + * While the current implementation prevents this optimization, it’s still + * possible to reduce the peak memory use when calls to `render_block()` + * on those top-level blocks are memory-heavy (which many of them are). + * By setting each parsed block to `NULL` after rendering it, any memory + * allocated during the render will be freed and reused for the next block. + * Before making this change, that memory was retained and would lead to + * out-of-memory crashes for certain posts that now run with this change. + */ + for ( $i = 0; $i < $top_level_block_count; $i++ ) { + $output .= render_block( $blocks[ $i ] ); + $blocks[ $i ] = null; } // If there are blocks in this content, we shouldn't run wpautop() on it later. diff --git a/src/wp-includes/capabilities.php b/src/wp-includes/capabilities.php index d6c340c95e..2464ef5a79 100644 --- a/src/wp-includes/capabilities.php +++ b/src/wp-includes/capabilities.php @@ -470,7 +470,7 @@ function map_meta_cap( $cap, $user_id, ...$args ) { if ( $meta_key ) { $allowed = ! is_protected_meta( $meta_key, $object_type ); - if ( ! empty( $object_subtype ) && has_filter( "auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}" ) ) { + if ( has_filter( "auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}" ) ) { /** * Filters whether the user is allowed to edit a specific meta key of a specific object type and subtype. @@ -512,36 +512,33 @@ function map_meta_cap( $cap, $user_id, ...$args ) { $allowed = apply_filters( "auth_{$object_type}_meta_{$meta_key}", $allowed, $meta_key, $object_id, $user_id, $cap, $caps ); } - if ( ! empty( $object_subtype ) ) { - - /** - * Filters whether the user is allowed to edit meta for specific object types/subtypes. - * - * Return true to have the mapped meta caps from `edit_{$object_type}` apply. - * - * The dynamic portion of the hook name, `$object_type` refers to the object type being filtered. - * The dynamic portion of the hook name, `$object_subtype` refers to the object subtype being filtered. - * The dynamic portion of the hook name, `$meta_key`, refers to the meta key passed to map_meta_cap(). - * - * @since 4.6.0 As `auth_post_{$post_type}_meta_{$meta_key}`. - * @since 4.7.0 Renamed from `auth_post_{$post_type}_meta_{$meta_key}` to - * `auth_{$object_type}_{$object_subtype}_meta_{$meta_key}`. - * @deprecated 4.9.8 Use {@see 'auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}'} instead. - * - * @param bool $allowed Whether the user can add the object meta. Default false. - * @param string $meta_key The meta key. - * @param int $object_id Object ID. - * @param int $user_id User ID. - * @param string $cap Capability name. - * @param string[] $caps Array of the user's capabilities. - */ - $allowed = apply_filters_deprecated( - "auth_{$object_type}_{$object_subtype}_meta_{$meta_key}", - array( $allowed, $meta_key, $object_id, $user_id, $cap, $caps ), - '4.9.8', - "auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}" - ); - } + /** + * Filters whether the user is allowed to edit meta for specific object types/subtypes. + * + * Return true to have the mapped meta caps from `edit_{$object_type}` apply. + * + * The dynamic portion of the hook name, `$object_type` refers to the object type being filtered. + * The dynamic portion of the hook name, `$object_subtype` refers to the object subtype being filtered. + * The dynamic portion of the hook name, `$meta_key`, refers to the meta key passed to map_meta_cap(). + * + * @since 4.6.0 As `auth_post_{$post_type}_meta_{$meta_key}`. + * @since 4.7.0 Renamed from `auth_post_{$post_type}_meta_{$meta_key}` to + * `auth_{$object_type}_{$object_subtype}_meta_{$meta_key}`. + * @deprecated 4.9.8 Use {@see 'auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}'} instead. + * + * @param bool $allowed Whether the user can add the object meta. Default false. + * @param string $meta_key The meta key. + * @param int $object_id Object ID. + * @param int $user_id User ID. + * @param string $cap Capability name. + * @param string[] $caps Array of the user's capabilities. + */ + $allowed = apply_filters_deprecated( + "auth_{$object_type}_{$object_subtype}_meta_{$meta_key}", + array( $allowed, $meta_key, $object_id, $user_id, $cap, $caps ), + '4.9.8', + "auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}" + ); if ( ! $allowed ) { $caps[] = $cap; @@ -1099,12 +1096,34 @@ function get_role( $role ) { /** * Adds a role, if it does not exist. * + * The list of capabilities can be passed either as a numerically indexed array of capability names, or an + * associative array of boolean values keyed by the capability name. To explicitly deny the role a capability, set + * the value for that capability to false. + * + * Examples: + * + * // Add a role that can edit posts. + * add_role( 'custom_role', 'Custom Role', array( + * 'read', + * 'edit_posts', + * ) ); + * + * Or, using an associative array: + * + * // Add a role that can edit posts but explicitly cannot not delete them. + * add_role( 'custom_role', 'Custom Role', array( + * 'read' => true, + * 'edit_posts' => true, + * 'delete_posts' => false, + * ) ); + * * @since 2.0.0 + * @since x.y.z Support was added for a numerically indexed array of strings for the capabilities array. * - * @param string $role Role name. - * @param string $display_name Display name for role. - * @param bool[] $capabilities List of capabilities keyed by the capability name, - * e.g. array( 'edit_posts' => true, 'delete_posts' => false ). + * @param string $role Role name. + * @param string $display_name Display name for role. + * @param array<string,bool>|array<int,string> $capabilities Capabilities to be added to the role. + * Default empty array. * @return WP_Role|void WP_Role object, if the role is added. */ function add_role( $role, $display_name, $capabilities = array() ) { diff --git a/src/wp-includes/category-template.php b/src/wp-includes/category-template.php index 0525ae792a..b2c88c9c25 100644 --- a/src/wp-includes/category-template.php +++ b/src/wp-includes/category-template.php @@ -71,7 +71,7 @@ function get_category_parents( $category_id, $link = false, $separator = '/', $n * * @since 0.71 * - * @param int $post_id Optional. The post ID. Defaults to current post ID. + * @param int|false $post_id Optional. The post ID. Defaults to current post ID. * @return WP_Term[] Array of WP_Term objects, one for each category assigned to the post. */ function get_the_category( $post_id = false ) { @@ -131,11 +131,11 @@ function get_the_category_by_ID( $cat_id ) { // phpcs:ignore WordPress.NamingCon * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * - * @param string $separator Optional. Separator between the categories. By default, the links are placed - * in an unordered list. An empty string will result in the default behavior. - * @param string $parents Optional. How to display the parents. Accepts 'multiple', 'single', or empty. - * Default empty string. - * @param int $post_id Optional. ID of the post to retrieve categories for. Defaults to the current post. + * @param string $separator Optional. Separator between the categories. By default, the links are placed + * in an unordered list. An empty string will result in the default behavior. + * @param string $parents Optional. How to display the parents. Accepts 'multiple', 'single', or empty. + * Default empty string. + * @param int|false $post_id Optional. ID of the post to retrieve categories for. Defaults to the current post. * @return string Category list for a post. */ function get_the_category_list( $separator = '', $parents = '', $post_id = false ) { @@ -251,7 +251,7 @@ function get_the_category_list( $separator = '', $parents = '', $post_id = false * * @param int|string|int[]|string[] $category Category ID, name, slug, or array of such * to check against. - * @param int|WP_Post $post Optional. Post to check. Defaults to the current post. + * @param int|null|WP_Post $post Optional. Post to check. Defaults to the current post. * @return bool True if the current post is in any of the given categories. */ function in_category( $category, $post = null ) { @@ -267,11 +267,11 @@ function in_category( $category, $post = null ) { * * @since 0.71 * - * @param string $separator Optional. Separator between the categories. By default, the links are placed - * in an unordered list. An empty string will result in the default behavior. - * @param string $parents Optional. How to display the parents. Accepts 'multiple', 'single', or empty. - * Default empty string. - * @param int $post_id Optional. ID of the post to retrieve categories for. Defaults to the current post. + * @param string $separator Optional. Separator between the categories. By default, the links are placed + * in an unordered list. An empty string will result in the default behavior. + * @param string $parents Optional. How to display the parents. Accepts 'multiple', 'single', or empty. + * Default empty string. + * @param int|false $post_id Optional. ID of the post to retrieve categories for. Defaults to the current post. */ function the_category( $separator = '', $parents = '', $post_id = false ) { echo get_the_category_list( $separator, $parents, $post_id ); @@ -793,7 +793,7 @@ function wp_tag_cloud( $args = '' ) { * @return int Scaled count. */ function default_topic_count_scale( $count ) { - return round( log10( $count + 1 ) * 100 ); + return (int) round( log10( $count + 1 ) * 100 ); } /** diff --git a/src/wp-includes/certificates/ca-bundle.crt b/src/wp-includes/certificates/ca-bundle.crt index 46fe2085ca..ba90f7a2d8 100644 --- a/src/wp-includes/certificates/ca-bundle.crt +++ b/src/wp-includes/certificates/ca-bundle.crt @@ -61,14 +61,14 @@ D/xwzoiQ ## ## Bundle of CA Root Certificates ## -## Certificate data from Mozilla as of: Tue Feb 25 04:12:03 2025 GMT +## Certificate data from Mozilla as of: Tue May 20 03:12:02 2025 GMT ## ## Find updated versions here: https://curl.se/docs/caextract.html ## ## This is a bundle of X.509 certificates of public Certificate Authorities ## (CA). These were automatically extracted from Mozilla's root certificates ## file (certdata.txt). This file can be found in the mozilla source tree: -## https://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt +## https://raw.githubusercontent.com/mozilla-firefox/firefox/refs/heads/release/security/nss/lib/ckfw/builtins/certdata.txt ## ## It contains the certificates in PEM format and therefore ## can be directly used with curl / libcurl / php_curl, or with @@ -76,76 +76,10 @@ D/xwzoiQ ## Just configure this file as the SSLCACertificateFile. ## ## Conversion done with mk-ca-bundle.pl version 1.29. -## SHA256: 620fd89c02acb0019f1899dab7907db5d20735904f5a9a0d3a8771a5857ac482 +## SHA256: 8944ec6b572b577daee4fc681a425881f841ec2660e4cb5f0eee727f84620697 ## -GlobalSign Root CA -================== ------BEGIN CERTIFICATE----- -MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx -GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds -b2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV -BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD -VQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa -DuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc -THAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb -Kk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP -c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX -gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV -HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF -AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj -Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG -j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH -hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC -X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== ------END CERTIFICATE----- - -Entrust.net Premium 2048 Secure Server CA -========================================= ------BEGIN CERTIFICATE----- -MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u -ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxp -bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV -BAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQx -NzUwNTFaFw0yOTA3MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3 -d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl -MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u -ZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEArU1LqRKGsuqjIAcVFmQqK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOL -Gp18EzoOH1u3Hs/lJBQesYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSr -hRSGlVuXMlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVTXTzW -nLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/HoZdenoVve8AjhUi -VBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH4QIDAQABo0IwQDAOBgNVHQ8BAf8E -BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJ -KoZIhvcNAQEFBQADggEBADubj1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPy -T/4xmf3IDExoU8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf -zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5bu/8j72gZyxKT -J1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+bYQLCIt+jerXmCHG8+c8eS9e -nNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/ErfF6adulZkMV8gzURZVE= ------END CERTIFICATE----- - -Baltimore CyberTrust Root -========================= ------BEGIN CERTIFICATE----- -MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJRTESMBAGA1UE -ChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYDVQQDExlCYWx0aW1vcmUgQ3li -ZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoXDTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMC -SUUxEjAQBgNVBAoTCUJhbHRpbW9yZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFs -dGltb3JlIEN5YmVyVHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKME -uyKrmD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjrIZ3AQSsB -UnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeKmpYcqWe4PwzV9/lSEy/C -G9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSuXmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9 -XbIGevOF6uvUA65ehD5f/xXtabz5OTZydc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjpr -l3RjM71oGDHweI12v/yejl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoI -VDaGezq1BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEB -BQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT929hkTI7gQCvlYpNRh -cL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3WgxjkzSswF07r51XgdIGn9w/xZchMB5 -hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsa -Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H -RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp ------END CERTIFICATE----- - Entrust Root Certification Authority ==================================== -----BEGIN CERTIFICATE----- @@ -172,30 +106,6 @@ W3iDVuycNsMm4hH2Z0kdkquM++v/eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0 tHuu2guQOHXvgR1m0vdXcDazv/wor3ElhVsT/h5/WrQ8 -----END CERTIFICATE----- -Comodo AAA Services root -======================== ------BEGIN CERTIFICATE----- -MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS -R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg -TGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAw -MFoXDTI4MTIzMTIzNTk1OVowezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hl -c3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV -BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQuaBtDFcCLNSS1UY8y2bmhG -C1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe3M/vg4aijJRPn2jymJBGhCfHdr/jzDUs -i14HZGWCwEiwqJH5YZ92IFCokcdmtet4YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszW -Y19zjNoFmag4qMsXeDZRrOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjH -Ypy+g8cmez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQUoBEK -Iz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wewYDVR0f -BHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20vQUFBQ2VydGlmaWNhdGVTZXJ2aWNl -cy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29tb2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2Vz -LmNybDANBgkqhkiG9w0BAQUFAAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm -7l3sAg9g1o1QGE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz -Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2G9w84FoVxp7Z -8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsil2D4kF501KKaU73yqWjgom7C -12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== ------END CERTIFICATE----- - QuoVadis Root CA 2 ================== -----BEGIN CERTIFICATE----- @@ -262,78 +172,6 @@ vGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeTmJlglFwjz1onl14LBQaTNx47aTbr qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto= -----END CERTIFICATE----- -XRamp Global CA Root -==================== ------BEGIN CERTIFICATE----- -MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UE -BhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2Vj -dXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB -dXRob3JpdHkwHhcNMDQxMTAxMTcxNDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMx -HjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkg -U2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3Jp -dHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS638eMpSe2OAtp87ZOqCwu -IR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCPKZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMx -foArtYzAQDsRhtDLooY2YKTVMIJt2W7QDxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FE -zG+gSqmUsE3a56k0enI4qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqs -AxcZZPRaJSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNViPvry -xS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud -EwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASsjVy16bYbMDYGA1UdHwQvMC0wK6Ap -oCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMC -AQEwDQYJKoZIhvcNAQEFBQADggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc -/Kh4ZzXxHfARvbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt -qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLaIR9NmXmd4c8n -nxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSyi6mx5O+aGtA9aZnuqCij4Tyz -8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQO+7ETPTsJ3xCwnR8gooJybQDJbw= ------END CERTIFICATE----- - -Go Daddy Class 2 CA -=================== ------BEGIN CERTIFICATE----- -MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMY -VGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRp -ZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkG -A1UEBhMCVVMxITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28g -RGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQAD -ggENADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCAPVYYYwhv -2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6wwdhFJ2+qN1j3hybX2C32 -qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXiEqITLdiOr18SPaAIBQi2XKVlOARFmR6j -YGB0xUGlcmIbYsUfb18aQr4CUWWoriMYavx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmY -vLEHZ6IVDd2gWMZEewo+YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0O -BBYEFNLEsNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h/t2o -atTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMu -MTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwG -A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wim -PQoZ+YeAEW5p5JYXMP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKt -I3lpjbi2Tc7PTMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ -HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VI -Ls9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b -vZ8= ------END CERTIFICATE----- - -Starfield Class 2 CA -==================== ------BEGIN CERTIFICATE----- -MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMc -U3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIg -Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQwNjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBo -MQswCQYDVQQGEwJVUzElMCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAG -A1UECxMpU3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqG -SIb3DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf8MOh2tTY -bitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN+lq2cwQlZut3f+dZxkqZ -JRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVm -epsZGD3/cVE8MC5fvj13c7JdBmzDI1aaK4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSN -F4Azbl5KXZnJHoe0nRrA1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HF -MIHCMB0GA1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fRzt0f -hvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNo -bm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBDbGFzcyAyIENlcnRpZmljYXRpb24g -QXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGs -afPzWdqbAYcaT1epoXkJKtv3L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLM -PUxA2IGvd56Deruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl -xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynpVSJYACPq4xJD -KVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3 -QBFGmh95DmK/D5fs4C8fF5Q= ------END CERTIFICATE----- - DigiCert Assured ID Root CA =========================== -----BEGIN CERTIFICATE----- diff --git a/src/wp-includes/certificates/cacert.pem b/src/wp-includes/certificates/cacert.pem index 584af3c0b4..4acd8e5365 100644 --- a/src/wp-includes/certificates/cacert.pem +++ b/src/wp-includes/certificates/cacert.pem @@ -1,14 +1,14 @@ ## ## Bundle of CA Root Certificates ## -## Certificate data from Mozilla as of: Tue Feb 25 04:12:03 2025 GMT +## Certificate data from Mozilla as of: Tue May 20 03:12:02 2025 GMT ## ## Find updated versions here: https://curl.se/docs/caextract.html ## ## This is a bundle of X.509 certificates of public Certificate Authorities ## (CA). These were automatically extracted from Mozilla's root certificates ## file (certdata.txt). This file can be found in the mozilla source tree: -## https://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt +## https://raw.githubusercontent.com/mozilla-firefox/firefox/refs/heads/release/security/nss/lib/ckfw/builtins/certdata.txt ## ## It contains the certificates in PEM format and therefore ## can be directly used with curl / libcurl / php_curl, or with @@ -16,76 +16,10 @@ ## Just configure this file as the SSLCACertificateFile. ## ## Conversion done with mk-ca-bundle.pl version 1.29. -## SHA256: 620fd89c02acb0019f1899dab7907db5d20735904f5a9a0d3a8771a5857ac482 +## SHA256: 8944ec6b572b577daee4fc681a425881f841ec2660e4cb5f0eee727f84620697 ## -GlobalSign Root CA -================== ------BEGIN CERTIFICATE----- -MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx -GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds -b2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV -BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD -VQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa -DuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc -THAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb -Kk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP -c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX -gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV -HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF -AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj -Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG -j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH -hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC -X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== ------END CERTIFICATE----- - -Entrust.net Premium 2048 Secure Server CA -========================================= ------BEGIN CERTIFICATE----- -MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u -ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxp -bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV -BAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQx -NzUwNTFaFw0yOTA3MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3 -d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl -MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u -ZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEArU1LqRKGsuqjIAcVFmQqK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOL -Gp18EzoOH1u3Hs/lJBQesYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSr -hRSGlVuXMlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVTXTzW -nLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/HoZdenoVve8AjhUi -VBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH4QIDAQABo0IwQDAOBgNVHQ8BAf8E -BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJ -KoZIhvcNAQEFBQADggEBADubj1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPy -T/4xmf3IDExoU8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf -zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5bu/8j72gZyxKT -J1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+bYQLCIt+jerXmCHG8+c8eS9e -nNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/ErfF6adulZkMV8gzURZVE= ------END CERTIFICATE----- - -Baltimore CyberTrust Root -========================= ------BEGIN CERTIFICATE----- -MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJRTESMBAGA1UE -ChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYDVQQDExlCYWx0aW1vcmUgQ3li -ZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoXDTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMC -SUUxEjAQBgNVBAoTCUJhbHRpbW9yZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFs -dGltb3JlIEN5YmVyVHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKME -uyKrmD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjrIZ3AQSsB -UnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeKmpYcqWe4PwzV9/lSEy/C -G9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSuXmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9 -XbIGevOF6uvUA65ehD5f/xXtabz5OTZydc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjpr -l3RjM71oGDHweI12v/yejl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoI -VDaGezq1BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEB -BQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT929hkTI7gQCvlYpNRh -cL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3WgxjkzSswF07r51XgdIGn9w/xZchMB5 -hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsa -Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H -RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp ------END CERTIFICATE----- - Entrust Root Certification Authority ==================================== -----BEGIN CERTIFICATE----- @@ -112,30 +46,6 @@ W3iDVuycNsMm4hH2Z0kdkquM++v/eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0 tHuu2guQOHXvgR1m0vdXcDazv/wor3ElhVsT/h5/WrQ8 -----END CERTIFICATE----- -Comodo AAA Services root -======================== ------BEGIN CERTIFICATE----- -MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS -R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg -TGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAw -MFoXDTI4MTIzMTIzNTk1OVowezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hl -c3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV -BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQuaBtDFcCLNSS1UY8y2bmhG -C1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe3M/vg4aijJRPn2jymJBGhCfHdr/jzDUs -i14HZGWCwEiwqJH5YZ92IFCokcdmtet4YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszW -Y19zjNoFmag4qMsXeDZRrOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjH -Ypy+g8cmez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQUoBEK -Iz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wewYDVR0f -BHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20vQUFBQ2VydGlmaWNhdGVTZXJ2aWNl -cy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29tb2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2Vz -LmNybDANBgkqhkiG9w0BAQUFAAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm -7l3sAg9g1o1QGE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz -Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2G9w84FoVxp7Z -8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsil2D4kF501KKaU73yqWjgom7C -12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== ------END CERTIFICATE----- - QuoVadis Root CA 2 ================== -----BEGIN CERTIFICATE----- @@ -202,78 +112,6 @@ vGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeTmJlglFwjz1onl14LBQaTNx47aTbr qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto= -----END CERTIFICATE----- -XRamp Global CA Root -==================== ------BEGIN CERTIFICATE----- -MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UE -BhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2Vj -dXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB -dXRob3JpdHkwHhcNMDQxMTAxMTcxNDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMx -HjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkg -U2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3Jp -dHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS638eMpSe2OAtp87ZOqCwu -IR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCPKZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMx -foArtYzAQDsRhtDLooY2YKTVMIJt2W7QDxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FE -zG+gSqmUsE3a56k0enI4qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqs -AxcZZPRaJSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNViPvry -xS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud -EwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASsjVy16bYbMDYGA1UdHwQvMC0wK6Ap -oCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMC -AQEwDQYJKoZIhvcNAQEFBQADggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc -/Kh4ZzXxHfARvbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt -qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLaIR9NmXmd4c8n -nxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSyi6mx5O+aGtA9aZnuqCij4Tyz -8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQO+7ETPTsJ3xCwnR8gooJybQDJbw= ------END CERTIFICATE----- - -Go Daddy Class 2 CA -=================== ------BEGIN CERTIFICATE----- -MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMY -VGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRp -ZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkG -A1UEBhMCVVMxITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28g -RGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQAD -ggENADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCAPVYYYwhv -2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6wwdhFJ2+qN1j3hybX2C32 -qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXiEqITLdiOr18SPaAIBQi2XKVlOARFmR6j -YGB0xUGlcmIbYsUfb18aQr4CUWWoriMYavx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmY -vLEHZ6IVDd2gWMZEewo+YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0O -BBYEFNLEsNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h/t2o -atTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMu -MTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwG -A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wim -PQoZ+YeAEW5p5JYXMP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKt -I3lpjbi2Tc7PTMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ -HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VI -Ls9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b -vZ8= ------END CERTIFICATE----- - -Starfield Class 2 CA -==================== ------BEGIN CERTIFICATE----- -MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMc -U3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIg -Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQwNjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBo -MQswCQYDVQQGEwJVUzElMCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAG -A1UECxMpU3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqG -SIb3DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf8MOh2tTY -bitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN+lq2cwQlZut3f+dZxkqZ -JRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVm -epsZGD3/cVE8MC5fvj13c7JdBmzDI1aaK4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSN -F4Azbl5KXZnJHoe0nRrA1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HF -MIHCMB0GA1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fRzt0f -hvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNo -bm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBDbGFzcyAyIENlcnRpZmljYXRpb24g -QXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGs -afPzWdqbAYcaT1epoXkJKtv3L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLM -PUxA2IGvd56Deruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl -xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynpVSJYACPq4xJD -KVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3 -QBFGmh95DmK/D5fs4C8fF5Q= ------END CERTIFICATE----- - DigiCert Assured ID Root CA =========================== -----BEGIN CERTIFICATE----- diff --git a/src/wp-includes/class-wp-block-list.php b/src/wp-includes/class-wp-block-list.php index e1151e6745..81f01eb0ca 100644 --- a/src/wp-includes/class-wp-block-list.php +++ b/src/wp-includes/class-wp-block-list.php @@ -19,7 +19,6 @@ class WP_Block_List implements Iterator, ArrayAccess, Countable { * * @since 5.5.0 * @var array[]|WP_Block[] - * @access protected */ protected $blocks; @@ -28,7 +27,6 @@ class WP_Block_List implements Iterator, ArrayAccess, Countable { * * @since 5.5.0 * @var array - * @access protected */ protected $available_context; @@ -37,7 +35,6 @@ class WP_Block_List implements Iterator, ArrayAccess, Countable { * * @since 5.5.0 * @var WP_Block_Type_Registry - * @access protected */ protected $registry; diff --git a/src/wp-includes/class-wp-block-pattern-categories-registry.php b/src/wp-includes/class-wp-block-pattern-categories-registry.php index 3d37a5940a..2d5fbcf2fe 100644 --- a/src/wp-includes/class-wp-block-pattern-categories-registry.php +++ b/src/wp-includes/class-wp-block-pattern-categories-registry.php @@ -107,7 +107,7 @@ final class WP_Block_Pattern_Categories_Registry { * @since 5.5.0 * * @param string $category_name Pattern category name including namespace. - * @return array Registered pattern properties. + * @return array|null Registered pattern properties, or `null` if the pattern category is not registered. */ public function get_registered( $category_name ) { if ( ! $this->is_registered( $category_name ) ) { diff --git a/src/wp-includes/class-wp-block-patterns-registry.php b/src/wp-includes/class-wp-block-patterns-registry.php index 3b5f053bfd..2afa8a853f 100644 --- a/src/wp-includes/class-wp-block-patterns-registry.php +++ b/src/wp-includes/class-wp-block-patterns-registry.php @@ -188,7 +188,7 @@ final class WP_Block_Patterns_Registry { * @since 5.5.0 * * @param string $pattern_name Block pattern name including namespace. - * @return array Registered pattern properties. + * @return array|null Registered pattern properties or `null` if the pattern is not registered. */ public function get_registered( $pattern_name ) { if ( ! $this->is_registered( $pattern_name ) ) { diff --git a/src/wp-includes/class-wp-block-styles-registry.php b/src/wp-includes/class-wp-block-styles-registry.php index 9a990173b4..8fb5e2eb23 100644 --- a/src/wp-includes/class-wp-block-styles-registry.php +++ b/src/wp-includes/class-wp-block-styles-registry.php @@ -140,7 +140,7 @@ final class WP_Block_Styles_Registry { * * @param string $block_name Block type name including namespace. * @param string $block_style_name Block style name. - * @return array Registered block style properties. + * @return array|null Registered block style properties or `null` if the block style is not registered. */ public function get_registered( $block_name, $block_style_name ) { if ( ! $this->is_registered( $block_name, $block_style_name ) ) { diff --git a/src/wp-includes/class-wp-block.php b/src/wp-includes/class-wp-block.php index d8fb177ebb..e3b97f6501 100644 --- a/src/wp-includes/class-wp-block.php +++ b/src/wp-includes/class-wp-block.php @@ -54,7 +54,6 @@ class WP_Block { * * @since 5.5.0 * @var array - * @access protected */ protected $available_context = array(); @@ -63,7 +62,6 @@ class WP_Block { * * @since 5.9.0 * @var WP_Block_Type_Registry - * @access protected */ protected $registry; diff --git a/src/wp-includes/class-wp-classic-to-block-menu-converter.php b/src/wp-includes/class-wp-classic-to-block-menu-converter.php index 6430aab6fa..b3cc819904 100644 --- a/src/wp-includes/class-wp-classic-to-block-menu-converter.php +++ b/src/wp-includes/class-wp-classic-to-block-menu-converter.php @@ -10,7 +10,6 @@ * Converts a Classic Menu to Block Menu blocks. * * @since 6.3.0 - * @access public */ class WP_Classic_To_Block_Menu_Converter { diff --git a/src/wp-includes/class-wp-comment-query.php b/src/wp-includes/class-wp-comment-query.php index 6a72c0d209..03d3479b6c 100644 --- a/src/wp-includes/class-wp-comment-query.php +++ b/src/wp-includes/class-wp-comment-query.php @@ -579,9 +579,7 @@ class WP_Comment_Query { } } - if ( ! empty( $status_clauses ) ) { - $approved_clauses[] = '( ' . implode( ' OR ', $status_clauses ) . ' )'; - } + $approved_clauses[] = '( ' . implode( ' OR ', $status_clauses ) . ' )'; } // User IDs or emails whose unapproved comments are included, regardless of $status. diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php index 51c88ef5fc..0d41d4a09b 100644 --- a/src/wp-includes/class-wp-customize-manager.php +++ b/src/wp-includes/class-wp-customize-manager.php @@ -3165,27 +3165,25 @@ final class WP_Customize_Manager { return; } - if ( $changeset_post_id ) { - if ( ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->delete_post, $changeset_post_id ) ) { - wp_send_json_error( - array( - 'code' => 'changeset_trash_unauthorized', - 'message' => __( 'Unable to trash changes.' ), - ) - ); - } + if ( ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->delete_post, $changeset_post_id ) ) { + wp_send_json_error( + array( + 'code' => 'changeset_trash_unauthorized', + 'message' => __( 'Unable to trash changes.' ), + ) + ); + } - $lock_user = (int) wp_check_post_lock( $changeset_post_id ); + $lock_user = (int) wp_check_post_lock( $changeset_post_id ); - if ( $lock_user && get_current_user_id() !== $lock_user ) { - wp_send_json_error( - array( - 'code' => 'changeset_locked', - 'message' => __( 'Changeset is being edited by other user.' ), - 'lockUser' => $this->get_lock_user_data( $lock_user ), - ) - ); - } + if ( $lock_user && get_current_user_id() !== $lock_user ) { + wp_send_json_error( + array( + 'code' => 'changeset_locked', + 'message' => __( 'Changeset is being edited by other user.' ), + 'lockUser' => $this->get_lock_user_data( $lock_user ), + ) + ); } if ( 'trash' === get_post_status( $changeset_post_id ) ) { diff --git a/src/wp-includes/class-wp-customize-widgets.php b/src/wp-includes/class-wp-customize-widgets.php index 3db46ad088..b24a9c8b47 100644 --- a/src/wp-includes/class-wp-customize-widgets.php +++ b/src/wp-includes/class-wp-customize-widgets.php @@ -921,10 +921,12 @@ final class WP_Customize_Widgets { </button> <h3> <span class="customize-action"> - <?php + <?php + $panel = $this->manager->get_panel( 'widgets' ); + $panel_title = isset( $panel->title ) ? $panel->title : __( 'Widgets' ); /* translators: ▸ is the unicode right-pointing triangle. %s: Section title in the Customizer. */ - printf( __( 'Customizing ▸ %s' ), esc_html( $this->manager->get_panel( 'widgets' )->title ) ); - ?> + printf( __( 'Customizing ▸ %s' ), esc_html( $panel_title ) ); + ?> </span> <?php _e( 'Add a Widget' ); ?> </h3> diff --git a/src/wp-includes/class-wp-image-editor-imagick.php b/src/wp-includes/class-wp-image-editor-imagick.php index 66085ac503..f57e6f281f 100644 --- a/src/wp-includes/class-wp-image-editor-imagick.php +++ b/src/wp-includes/class-wp-image-editor-imagick.php @@ -305,7 +305,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { * image operations within the time of the HTTP request. * * @since 6.2.0 - * @since 6.3.0 This method was deprecated. + * @deprecated 6.3.0 No longer used in core. * * @return int|null The new limit on success, null on failure. */ @@ -484,37 +484,28 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { $this->image->setOption( 'png:compression-filter', '5' ); $this->image->setOption( 'png:compression-level', '9' ); $this->image->setOption( 'png:compression-strategy', '1' ); - // Check to see if a PNG is indexed, and find the pixel depth. - if ( is_callable( array( $this->image, 'getImageDepth' ) ) ) { - $indexed_pixel_depth = $this->image->getImageDepth(); - - // Indexed PNG files get some additional handling. - if ( 0 < $indexed_pixel_depth && 8 >= $indexed_pixel_depth ) { - // Check for an alpha channel. - if ( - is_callable( array( $this->image, 'getImageAlphaChannel' ) ) - && $this->image->getImageAlphaChannel() - ) { - $this->image->setOption( 'png:include-chunk', 'tRNS' ); - } else { - $this->image->setOption( 'png:exclude-chunk', 'all' ); - } - - // Reduce colors in the images to maximum needed, using the global colorspace. - $max_colors = pow( 2, $indexed_pixel_depth ); - if ( is_callable( array( $this->image, 'getImageColors' ) ) ) { - $current_colors = $this->image->getImageColors(); - $max_colors = min( $max_colors, $current_colors ); - } - $this->image->quantizeImage( $max_colors, $this->image->getColorspace(), 0, false, false ); - - /** - * If the colorspace is 'gray', use the png8 format to ensure it stays indexed. - */ - if ( Imagick::COLORSPACE_GRAY === $this->image->getImageColorspace() ) { - $this->image->setOption( 'png:format', 'png8' ); - } + + // Indexed PNG files get some additional handling. + // See #63448 for details. + if ( + is_callable( array( $this->image, 'getImageProperty' ) ) + && '3' === $this->image->getImageProperty( 'png:IHDR.color-type-orig' ) + ) { + + // Check for an alpha channel. + if ( + is_callable( array( $this->image, 'getImageAlphaChannel' ) ) + && $this->image->getImageAlphaChannel() + ) { + $this->image->setOption( 'png:include-chunk', 'tRNS' ); + } else { + $this->image->setOption( 'png:exclude-chunk', 'all' ); } + // Set the image format to Indexed PNG. + $this->image->setOption( 'png:format', 'png8' ); + + } else { + $this->image->setOption( 'png:exclude-chunk', 'all' ); } } diff --git a/src/wp-includes/class-wp-locale-switcher.php b/src/wp-includes/class-wp-locale-switcher.php index db4ae298c6..55edef3c9c 100644 --- a/src/wp-includes/class-wp-locale-switcher.php +++ b/src/wp-includes/class-wp-locale-switcher.php @@ -287,7 +287,7 @@ class WP_Locale_Switcher { WP_Translation_Controller::get_instance()->set_locale( $locale ); if ( $phpmailer instanceof WP_PHPMailer ) { - $phpmailer->SetLanguage(); + $phpmailer->setLanguage(); } /** diff --git a/src/wp-includes/class-wp-navigation-fallback.php b/src/wp-includes/class-wp-navigation-fallback.php index 59fe023d80..573ab27f34 100644 --- a/src/wp-includes/class-wp-navigation-fallback.php +++ b/src/wp-includes/class-wp-navigation-fallback.php @@ -12,7 +12,6 @@ /** * Manages fallback behavior for Navigation menus. * - * @access public * @since 6.3.0 */ class WP_Navigation_Fallback { diff --git a/src/wp-includes/class-wp-oembed.php b/src/wp-includes/class-wp-oembed.php index 2d59c2217d..8d153c8fa0 100644 --- a/src/wp-includes/class-wp-oembed.php +++ b/src/wp-includes/class-wp-oembed.php @@ -89,7 +89,6 @@ class WP_oEmbed { '#https?://videopress\.com/v/.*#' => array( 'https://public-api.wordpress.com/oembed/?for=' . $host, true ), '#https?://(www\.)?reddit\.com/r/[^/]+/comments/.*#i' => array( 'https://www.reddit.com/oembed', true ), '#https?://(www\.)?speakerdeck\.com/.*#i' => array( 'https://speakerdeck.com/oembed.{format}', true ), - '#https?://(www\.)?screencast\.com/.*#i' => array( 'https://api.screencast.com/external/oembed', true ), '#https?://([a-z0-9-]+\.)?amazon\.(com|com\.mx|com\.br|ca)/.*#i' => array( 'https://read.amazon.com/kp/api/oembed', true ), '#https?://([a-z0-9-]+\.)?amazon\.(co\.uk|de|fr|it|es|in|nl|ru)/.*#i' => array( 'https://read.amazon.co.uk/kp/api/oembed', true ), '#https?://([a-z0-9-]+\.)?amazon\.(co\.jp|com\.au)/.*#i' => array( 'https://read.amazon.com.au/kp/api/oembed', true ), @@ -216,6 +215,7 @@ class WP_oEmbed { * | Meetup.com | meetup.com | 3.9.0 | 6.0.1 | * | Meetup.com | meetu.ps | 3.9.0 | 6.0.1 | * | SlideShare | slideshare.net | 3.5.0 | 6.6.0 | + * | Screencast | screencast.com | 4.8.0 | 6.8.2 | * * @see wp_oembed_add_provider() * @@ -739,9 +739,9 @@ class WP_oEmbed { * * @since 2.9.0 * - * @param string $return The returned oEmbed HTML. - * @param object $data A data object result from an oEmbed provider. - * @param string $url The URL of the content to be embedded. + * @param string|false $return The returned oEmbed HTML, or false on failure. + * @param object $data A data object result from an oEmbed provider. + * @param string $url The URL of the content to be embedded. */ return apply_filters( 'oembed_dataparse', $return, $data, $url ); } @@ -752,10 +752,10 @@ class WP_oEmbed { * @since 2.9.0 as strip_scribd_newlines() * @since 3.0.0 * - * @param string $html Existing HTML. - * @param object $data Data object from WP_oEmbed::data2html() - * @param string $url The original URL passed to oEmbed. - * @return string Possibly modified $html + * @param string|false $html Existing HTML. + * @param object $data Data object from WP_oEmbed::data2html() + * @param string $url The original URL passed to oEmbed. + * @return string|false Possibly modified $html. */ public function _strip_newlines( $html, $data, $url ) { if ( ! str_contains( $html, "\n" ) ) { diff --git a/src/wp-includes/class-wp-phpmailer.php b/src/wp-includes/class-wp-phpmailer.php index b3c976d13d..ce71eec458 100644 --- a/src/wp-includes/class-wp-phpmailer.php +++ b/src/wp-includes/class-wp-phpmailer.php @@ -24,7 +24,7 @@ class WP_PHPMailer extends PHPMailer\PHPMailer\PHPMailer { */ public function __construct( $exceptions = false ) { parent::__construct( $exceptions ); - $this->SetLanguage(); + $this->setLanguage(); } /** @@ -32,10 +32,12 @@ class WP_PHPMailer extends PHPMailer\PHPMailer\PHPMailer { * * @since 6.8.0 * + * @param string $langcode Optional. Unused. ISO 639-1 2-character language code. Default 'en'. + * @param string $lang_path Optional. Unused. Path to the language file directory. Default empty string. * @return true Always returns true. */ - public function SetLanguage( $langcode = 'en', $lang_path = '' ) { - $error_strings = array( + public function setLanguage( $langcode = 'en', $lang_path = '' ) { + $this->language = array( 'authenticate' => __( 'SMTP Error: Could not authenticate.' ), 'buggy_php' => sprintf( /* translators: 1: mail.add_x_header. 2: php.ini */ @@ -65,7 +67,7 @@ class WP_PHPMailer extends PHPMailer\PHPMailer\PHPMailer { 'invalid_address' => __( 'Invalid address: ' ), 'invalid_header' => __( 'Invalid header name or value' ), /* translators: There is a space after the colon. */ - 'invalid_hostentry' => __( 'Invalid hostentry: ' ), + 'invalid_hostentry' => __( 'Invalid host entry: ' ), /* translators: There is a space after the colon. */ 'invalid_host' => __( 'Invalid host: ' ), /* translators: There is a space at the beginning. */ @@ -87,7 +89,7 @@ class WP_PHPMailer extends PHPMailer\PHPMailer\PHPMailer { /* translators: There is a space after the colon. */ 'variable_set' => __( 'Cannot set or reset variable: ' ), ); - $this->language = $error_strings; + return true; } } diff --git a/src/wp-includes/class-wp-roles.php b/src/wp-includes/class-wp-roles.php index 95e08e6dc7..0b94e0f959 100644 --- a/src/wp-includes/class-wp-roles.php +++ b/src/wp-includes/class-wp-roles.php @@ -143,16 +143,34 @@ class WP_Roles { * * Updates the list of roles, if the role doesn't already exist. * - * The capabilities are defined in the following format: `array( 'read' => true )`. - * To explicitly deny the role a capability, set the value for that capability to false. + * The list of capabilities can be passed either as a numerically indexed array of capability names, or an + * associative array of boolean values keyed by the capability name. To explicitly deny the role a capability, set + * the value for that capability to false. + * + * Examples: + * + * // Add a role that can edit posts. + * wp_roles()->add_role( 'custom_role', 'Custom Role', array( + * 'read', + * 'edit_posts', + * ) ); + * + * Or, using an associative array: + * + * // Add a role that can edit posts but explicitly cannot not delete them. + * wp_roles()->add_role( 'custom_role', 'Custom Role', array( + * 'read' => true, + * 'edit_posts' => true, + * 'delete_posts' => false, + * ) ); * * @since 2.0.0 + * @since x.y.z Support was added for a numerically indexed array of strings for the capabilities array. * - * @param string $role Role name. - * @param string $display_name Role display name. - * @param bool[] $capabilities Optional. List of capabilities keyed by the capability name, - * e.g. `array( 'edit_posts' => true, 'delete_posts' => false )`. - * Default empty array. + * @param string $role Role name. + * @param string $display_name Role display name. + * @param array<string,bool>|array<int,string> $capabilities Capabilities to be added to the role. + * Default empty array. * @return WP_Role|void WP_Role object, if the role is added. */ public function add_role( $role, $display_name, $capabilities = array() ) { @@ -160,6 +178,10 @@ class WP_Roles { return; } + if ( wp_is_numeric_array( $capabilities ) ) { + $capabilities = array_fill_keys( $capabilities, true ); + } + $this->roles[ $role ] = array( 'name' => $display_name, 'capabilities' => $capabilities, diff --git a/src/wp-includes/class-wp-site.php b/src/wp-includes/class-wp-site.php index fcd07cd5e3..715585316c 100644 --- a/src/wp-includes/class-wp-site.php +++ b/src/wp-includes/class-wp-site.php @@ -126,7 +126,7 @@ final class WP_Site { public $spam = '0'; /** - * Whether the site should be treated as deleted. + * Whether the site should be treated as flagged for deletion. * * A numeric string, for compatibility reasons. * diff --git a/src/wp-includes/class-wp-tax-query.php b/src/wp-includes/class-wp-tax-query.php index 5a489f5662..c6ec3258cc 100644 --- a/src/wp-includes/class-wp-tax-query.php +++ b/src/wp-includes/class-wp-tax-query.php @@ -44,7 +44,7 @@ class WP_Tax_Query { * Standard response when the query should not return any rows. * * @since 3.2.0 - * @var string + * @var array<string, array<string>> */ private static $no_results = array( 'join' => array( '' ), diff --git a/src/wp-includes/class-wp-theme-json.php b/src/wp-includes/class-wp-theme-json.php index f3f015ccd3..588aeaa89e 100644 --- a/src/wp-includes/class-wp-theme-json.php +++ b/src/wp-includes/class-wp-theme-json.php @@ -2781,6 +2781,7 @@ class WP_Theme_JSON { if ( isset( $theme_json['styles']['blocks'][ $name ]['elements'] ) ) { foreach ( $theme_json['styles']['blocks'][ $name ]['elements'] as $element => $node ) { $node_path = array( 'styles', 'blocks', $name, 'elements', $element ); + if ( $include_node_paths_only ) { $nodes[] = array( 'path' => $node_path, @@ -2798,12 +2799,6 @@ class WP_Theme_JSON { foreach ( static::VALID_ELEMENT_PSEUDO_SELECTORS[ $element ] as $pseudo_selector ) { if ( isset( $theme_json['styles']['blocks'][ $name ]['elements'][ $element ][ $pseudo_selector ] ) ) { $node_path = array( 'styles', 'blocks', $name, 'elements', $element ); - if ( $include_node_paths_only ) { - $nodes[] = array( - 'path' => $node_path, - ); - continue; - } $nodes[] = array( 'path' => $node_path, diff --git a/src/wp-includes/class-wp-xmlrpc-server.php b/src/wp-includes/class-wp-xmlrpc-server.php index 665fc72b0c..3b50d393de 100644 --- a/src/wp-includes/class-wp-xmlrpc-server.php +++ b/src/wp-includes/class-wp-xmlrpc-server.php @@ -5152,7 +5152,7 @@ class wp_xmlrpc_server extends IXR_Server { $post_content = xmlrpc_removepostdata( $content ); $post_date = current_time( 'mysql' ); - $post_date_gmt = current_time( 'mysql', 1 ); + $post_date_gmt = current_time( 'mysql', true ); $post_data = compact( 'post_author', diff --git a/src/wp-includes/class-wpdb.php b/src/wp-includes/class-wpdb.php index c6e6099c26..1aec294317 100644 --- a/src/wp-includes/class-wpdb.php +++ b/src/wp-includes/class-wpdb.php @@ -43,7 +43,7 @@ define( 'ARRAY_N', 'ARRAY_N' ); * By default, WordPress uses this class to instantiate the global $wpdb object, providing * access to the WordPress database. * - * It is possible to replace this class with your own by setting the $wpdb global variable + * It is possible to replace the global instance with your own by setting the $wpdb global variable * in wp-content/db.php file to your class. The wpdb class will still be included, so you can * extend it or simply use your own. * @@ -237,7 +237,6 @@ class wpdb { * WordPress table prefix. * * You can set this to have multiple WordPress installations in a single database. - * The second reason is for possible security precautions. * * @since 2.5.0 * @@ -941,7 +940,7 @@ class wpdb { /** * Changes the current SQL mode, and ensures its WordPress compatibility. * - * If no modes are passed, it will ensure the current MySQL server modes are compatible. + * If no modes are passed, it will ensure the current SQL server modes are compatible. * * @since 3.9.0 * @@ -1369,7 +1368,7 @@ class wpdb { } /** - * Quotes an identifier for a MySQL database, e.g. table/field names. + * Quotes an identifier such as a table or field name. * * @since 6.2.0 * @@ -1435,6 +1434,13 @@ class wpdb { * 'foo' * ); * + * $wpdb->prepare( + * "SELECT * FROM %i WHERE %i = %s", + * $table, + * $field, + * $value + * ); + * * @since 2.3.0 * @since 5.3.0 Formalized the existing and already documented `...$args` parameter * by updating the function signature. The second parameter was changed @@ -1957,7 +1963,7 @@ class wpdb { $client_flags = defined( 'MYSQL_CLIENT_FLAGS' ) ? MYSQL_CLIENT_FLAGS : 0; /* - * Set the MySQLi error reporting off because WordPress handles its own. + * Switch error reporting off because WordPress handles its own. * This is due to the default value change from `MYSQLI_REPORT_OFF` * to `MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT` in PHP 8.1. */ @@ -2100,7 +2106,7 @@ class wpdb { } $host = ! empty( $matches['host'] ) ? $matches['host'] : ''; - // MySQLi port cannot be a string; must be null or an integer. + // Port cannot be a string; must be null or an integer. $port = ! empty( $matches['port'] ) ? absint( $matches['port'] ) : null; return array( $host, $port, $socket, $is_ipv6 ); @@ -2290,7 +2296,7 @@ class wpdb { if ( $this->dbh instanceof mysqli ) { $this->last_error = mysqli_error( $this->dbh ); } else { - $this->last_error = __( 'Unable to retrieve the error message from MySQL' ); + $this->last_error = __( 'Unable to retrieve the error message from the database server' ); } if ( $this->last_error ) { @@ -2866,8 +2872,12 @@ class wpdb { * @return array { * Array of values and formats keyed by their field names. * - * @type mixed $value The value to be formatted. - * @type string $format The format to be mapped to the value. + * @type array ...$0 { + * Value and format for this field. + * + * @type mixed $value The value to be formatted. + * @type string $format The format to be mapped to the value. + * } * } */ protected function process_field_formats( $data, $format ) { @@ -3469,7 +3479,7 @@ class wpdb { } /** - * Checks if the query is accessing a collation considered safe on the current version of MySQL. + * Checks if the query is accessing a collation considered safe. * * @since 4.2.0 * @@ -3983,11 +3993,11 @@ class wpdb { } /** - * Determines whether MySQL database is at least the required minimum version. + * Determines whether the database server is at least the required minimum version. * * @since 2.5.0 * - * @global string $required_mysql_version The required MySQL version string. + * @global string $required_mysql_version The minimum required MySQL version string. * @return void|WP_Error */ public function check_database_version() { @@ -4043,7 +4053,7 @@ class wpdb { * * Capability sniffs for the database server and current version of WPDB. * - * Database sniffs are based on the version of MySQL the site is using. + * Database sniffs are based on the version of the database server in use. * * WPDB sniffs are added as new features are introduced to allow theme and plugin * developers to determine feature support. This is to account for drop-ins which may @@ -4115,7 +4125,7 @@ class wpdb { } /** - * Retrieves the database server version. + * Retrieves the database server version number. * * @since 2.7.0 * @@ -4126,11 +4136,11 @@ class wpdb { } /** - * Returns the version of the MySQL server. + * Returns the raw version string of the database server. * * @since 5.5.0 * - * @return string Server version as a string. + * @return string Database server version as a string. */ public function db_server_info() { return mysqli_get_server_info( $this->dbh ); diff --git a/src/wp-includes/comment-template.php b/src/wp-includes/comment-template.php index 9190cf6eff..59f89f3a84 100644 --- a/src/wp-includes/comment-template.php +++ b/src/wp-includes/comment-template.php @@ -834,12 +834,8 @@ function get_comment_link( $comment = null, $args = array() ) { if ( $cpage && get_option( 'page_comments' ) ) { if ( $wp_rewrite->using_permalinks() ) { - if ( $cpage ) { - $comment_link = trailingslashit( $comment_link ) . $wp_rewrite->comments_pagination_base . '-' . $cpage; - } - - $comment_link = user_trailingslashit( $comment_link, 'comment' ); - } elseif ( $cpage ) { + $comment_link = trailingslashit( $comment_link ) . $wp_rewrite->comments_pagination_base . '-' . $cpage; + } else { $comment_link = add_query_arg( 'cpage', $cpage, $comment_link ); } } @@ -1754,7 +1750,7 @@ function comments_popup_link( $zero = false, $one = false, $more = false, $css_c * @param int|WP_Comment $comment Optional. Comment being replied to. Default current comment. * @param int|WP_Post $post Optional. Post ID or WP_Post object the comment is going to be displayed on. * Default current post. - * @return string|false|null Link to show comment form, if successful. False, if comments are closed. + * @return string|false|null Link to show comment form on success. False if comments are closed. Null on failure. */ function get_comment_reply_link( $args = array(), $comment = null, $post = null ) { $defaults = array( @@ -1777,13 +1773,13 @@ function get_comment_reply_link( $args = array(), $comment = null, $post = null $args['depth'] = (int) $args['depth']; if ( 0 === $args['depth'] || $args['max_depth'] <= $args['depth'] ) { - return; + return null; } $comment = get_comment( $comment ); if ( empty( $comment ) ) { - return; + return null; } if ( empty( $post ) ) { @@ -1911,9 +1907,9 @@ function comment_reply_link( $args = array(), $comment = null, $post = null ) { * @type string $before Text or HTML to add before the reply link. Default empty. * @type string $after Text or HTML to add after the reply link. Default empty. * } - * @param int|WP_Post $post Optional. Post ID or WP_Post object the comment is going to be displayed on. - * Default current post. - * @return string|false|null Link to show comment form, if successful. False, if comments are closed. + * @param int|WP_Post $post Optional. Post ID or WP_Post object the comment is going to be displayed on. + * Default current post. + * @return string|false Link to show comment form on success. False if comments are closed. */ function get_post_reply_link( $args = array(), $post = null ) { $defaults = array( @@ -2095,8 +2091,8 @@ function comment_id_fields( $post = null ) { * * Only affects users with JavaScript disabled. * - * @internal The $comment global must be present to allow template tags access to the current - * comment. See https://core.trac.wordpress.org/changeset/36512. + * {@internal The $comment global must be present to allow template tags access to the current + * comment. See https://core.trac.wordpress.org/changeset/36512.} * * @since 2.7.0 * @since 6.2.0 Added the `$post` parameter. @@ -2446,6 +2442,7 @@ function wp_list_comments( $args = array(), $comments = null ) { * @since 4.6.0 Introduced the 'action' argument. * @since 4.9.6 Introduced the 'cookies' default comment field. * @since 5.5.0 Introduced the 'class_container' argument. + * @since 6.8.2 Introduced the 'novalidate' argument. * * @param array $args { * Optional. Default arguments and form fields to override. @@ -2467,6 +2464,7 @@ function wp_list_comments( $args = array(), $comments = null ) { * Default 'Your email address will not be published.'. * @type string $comment_notes_after HTML element for a message displayed after the textarea field. * @type string $action The comment form element action attribute. Default '/wp-comments-post.php'. + * @type bool $novalidate Whether the novalidate attribute is added to the comment form. Default false. * @type string $id_form The comment form element id attribute. Default 'commentform'. * @type string $id_submit The comment submit element id attribute. Default 'submit'. * @type string $class_container The comment form container class attribute. Default 'comment-respond'. @@ -2646,6 +2644,7 @@ function comment_form( $args = array(), $post = null ) { ), 'comment_notes_after' => '', 'action' => site_url( '/wp-comments-post.php' ), + 'novalidate' => false, 'id_form' => 'commentform', 'id_submit' => 'submit', 'class_container' => 'comment-respond', @@ -2729,7 +2728,7 @@ function comment_form( $args = array(), $post = null ) { esc_url( $args['action'] ), esc_attr( $args['id_form'] ), esc_attr( $args['class_form'] ), - ( $html5 ? ' novalidate' : '' ) + ( $args['novalidate'] ? ' novalidate' : '' ) ); /** diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php index 20c219cd27..aabe9f60db 100644 --- a/src/wp-includes/comment.php +++ b/src/wp-includes/comment.php @@ -446,6 +446,8 @@ function get_comment_count( $post_id = 0 ) { /** * Adds meta data field to a comment. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 2.9.0 * * @link https://developer.wordpress.org/reference/functions/add_comment_meta/ @@ -474,6 +476,8 @@ function add_comment_meta( $comment_id, $meta_key, $meta_value, $unique = false * value, will keep from removing duplicate metadata with the same key. It also * allows removing all metadata matching key, if needed. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 2.9.0 * * @link https://developer.wordpress.org/reference/functions/delete_comment_meta/ @@ -540,6 +544,8 @@ function wp_lazyload_comment_meta( array $comment_ids ) { * * If the meta field for the comment does not exist, it will be added. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 2.9.0 * * @link https://developer.wordpress.org/reference/functions/update_comment_meta/ @@ -926,8 +932,8 @@ function wp_check_comment_flood( $is_flood, $ip, $email, $date, $avoid_die = fal * * @since 2.7.0 * - * @param WP_Comment[] $comments Array of comments - * @return WP_Comment[] Array of comments keyed by comment_type. + * @param WP_Comment[] $comments Array of comments. + * @return array<string, WP_Comment[]> Array of comments keyed by comment type. */ function separate_comments( &$comments ) { $comments_by_type = array( @@ -1044,7 +1050,7 @@ function get_page_of_comment( $comment_id, $args = array() ) { $comment = get_comment( $comment_id ); if ( ! $comment ) { - return; + return null; } $defaults = array( @@ -2319,7 +2325,7 @@ function wp_new_comment( $commentdata, $wp_error = false ) { } if ( empty( $commentdata['comment_date_gmt'] ) ) { - $commentdata['comment_date_gmt'] = current_time( 'mysql', 1 ); + $commentdata['comment_date_gmt'] = current_time( 'mysql', true ); } if ( empty( $commentdata['comment_type'] ) ) { @@ -3054,22 +3060,19 @@ function do_trackbacks( $post ) { $post_title = apply_filters( 'the_title', $post->post_title, $post->ID ); $post_title = strip_tags( $post_title ); - if ( $to_ping ) { - foreach ( (array) $to_ping as $tb_ping ) { - $tb_ping = trim( $tb_ping ); - if ( ! in_array( $tb_ping, $pinged, true ) ) { - trackback( $tb_ping, $post_title, $excerpt, $post->ID ); - $pinged[] = $tb_ping; - } else { - $wpdb->query( - $wpdb->prepare( - "UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, %s, - '')) WHERE ID = %d", - $tb_ping, - $post->ID - ) - ); - } + foreach ( (array) $to_ping as $tb_ping ) { + $tb_ping = trim( $tb_ping ); + if ( ! in_array( $tb_ping, $pinged, true ) ) { + trackback( $tb_ping, $post_title, $excerpt, $post->ID ); + $pinged[] = $tb_ping; + } else { + $wpdb->query( + $wpdb->prepare( + "UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, %s, '')) WHERE ID = %d", + $tb_ping, + $post->ID + ) + ); } } } @@ -3430,9 +3433,9 @@ function _prime_comment_caches( $comment_ids, $update_meta_cache = true ) { * @since 2.7.0 * @access private * - * @param WP_Post $posts Post data object. - * @param WP_Query $query Query object. - * @return array + * @param WP_Post[] $posts Array of post objects. + * @param WP_Query $query Query object. + * @return WP_Post[] */ function _close_comments_for_old_posts( $posts, $query ) { if ( empty( $posts ) || ! $query->is_singular() || ! get_option( 'close_comments_for_old_posts' ) ) { diff --git a/src/wp-includes/compat.php b/src/wp-includes/compat.php index fc6db436fe..f0bdf07974 100644 --- a/src/wp-includes/compat.php +++ b/src/wp-includes/compat.php @@ -13,6 +13,16 @@ // If gettext isn't available. if ( ! function_exists( '_' ) ) { + /** + * Compat function to mimic _(), an alias of gettext(). + * + * @since 0.71 + * + * @see https://php.net/manual/en/function.gettext.php + * + * @param string $message The message being translated. + * @return string + */ function _( $message ) { return $message; } diff --git a/src/wp-includes/css/wp-embed-template.css b/src/wp-includes/css/wp-embed-template.css index b5a482b737..7b86fdd3d3 100644 --- a/src/wp-includes/css/wp-embed-template.css +++ b/src/wp-includes/css/wp-embed-template.css @@ -39,15 +39,15 @@ body { } .dashicons-admin-comments { - background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M5%202h9q.82%200%201.41.59T16%204v7q0%20.82-.59%201.41T14%2013h-2l-5%205v-5H5q-.82%200-1.41-.59T3%2011V4q0-.82.59-1.41T5%202z%27%20fill%3D%27%2382878c%27%2F%3E%3C%2Fsvg%3E"); + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M5%202h9q.82%200%201.41.59T16%204v7q0%20.82-.59%201.41T14%2013h-2l-5%205v-5H5q-.82%200-1.41-.59T3%2011V4q0-.82.59-1.41T5%202z%27%20fill%3D%27%23646970%27%2F%3E%3C%2Fsvg%3E"); } .wp-embed-comments a:hover .dashicons-admin-comments { - background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M5%202h9q.82%200%201.41.59T16%204v7q0%20.82-.59%201.41T14%2013h-2l-5%205v-5H5q-.82%200-1.41-.59T3%2011V4q0-.82.59-1.41T5%202z%27%20fill%3D%27%230073aa%27%2F%3E%3C%2Fsvg%3E"); + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M5%202h9q.82%200%201.41.59T16%204v7q0%20.82-.59%201.41T14%2013h-2l-5%205v-5H5q-.82%200-1.41-.59T3%2011V4q0-.82.59-1.41T5%202z%27%20fill%3D%27%23135e96%27%2F%3E%3C%2Fsvg%3E"); } .dashicons-share { - background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.5%2012q1.24%200%202.12.88T17.5%2015t-.88%202.12-2.12.88-2.12-.88T11.5%2015q0-.34.09-.69l-4.38-2.3Q6.32%2013%205%2013q-1.24%200-2.12-.88T2%2010t.88-2.12T5%207q1.3%200%202.21.99l4.38-2.3q-.09-.35-.09-.69%200-1.24.88-2.12T14.5%202t2.12.88T17.5%205t-.88%202.12T14.5%208q-1.3%200-2.21-.99l-4.38%202.3Q8%209.66%208%2010t-.09.69l4.38%202.3q.89-.99%202.21-.99z%27%20fill%3D%27%2382878c%27%2F%3E%3C%2Fsvg%3E"); + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.5%2012q1.24%200%202.12.88T17.5%2015t-.88%202.12-2.12.88-2.12-.88T11.5%2015q0-.34.09-.69l-4.38-2.3Q6.32%2013%205%2013q-1.24%200-2.12-.88T2%2010t.88-2.12T5%207q1.3%200%202.21.99l4.38-2.3q-.09-.35-.09-.69%200-1.24.88-2.12T14.5%202t2.12.88T17.5%205t-.88%202.12T14.5%208q-1.3%200-2.21-.99l-4.38%202.3Q8%209.66%208%2010t-.09.69l4.38%202.3q.89-.99%202.21-.99z%27%20fill%3D%27%23646970%27%2F%3E%3C%2Fsvg%3E"); display: none; } @@ -56,7 +56,7 @@ body { } .wp-embed-share-dialog-open:hover .dashicons-share { - background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.5%2012q1.24%200%202.12.88T17.5%2015t-.88%202.12-2.12.88-2.12-.88T11.5%2015q0-.34.09-.69l-4.38-2.3Q6.32%2013%205%2013q-1.24%200-2.12-.88T2%2010t.88-2.12T5%207q1.3%200%202.21.99l4.38-2.3q-.09-.35-.09-.69%200-1.24.88-2.12T14.5%202t2.12.88T17.5%205t-.88%202.12T14.5%208q-1.3%200-2.21-.99l-4.38%202.3Q8%209.66%208%2010t-.09.69l4.38%202.3q.89-.99%202.21-.99z%27%20fill%3D%27%230073aa%27%2F%3E%3C%2Fsvg%3E"); + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.5%2012q1.24%200%202.12.88T17.5%2015t-.88%202.12-2.12.88-2.12-.88T11.5%2015q0-.34.09-.69l-4.38-2.3Q6.32%2013%205%2013q-1.24%200-2.12-.88T2%2010t.88-2.12T5%207q1.3%200%202.21.99l4.38-2.3q-.09-.35-.09-.69%200-1.24.88-2.12T14.5%202t2.12.88T17.5%205t-.88%202.12T14.5%208q-1.3%200-2.21-.99l-4.38%202.3Q8%209.66%208%2010t-.09.69l4.38%202.3q.89-.99%202.21-.99z%27%20fill%3D%27%23135e96%27%2F%3E%3C%2Fsvg%3E"); } .wp-embed { @@ -65,7 +65,7 @@ body { font-weight: 400; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; line-height: 1.5; - color: #8c8f94; + color: #646970; background: #fff; border: 1px solid #dcdcde; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); @@ -75,7 +75,7 @@ body { } .wp-embed a { - color: #8c8f94; + color: #646970; text-decoration: none; } @@ -115,7 +115,8 @@ p.wp-embed-heading { } .wp-embed .wp-embed-more { - color: #c3c4c7; + color: #2271b1; + text-decoration: underline; } .wp-embed-footer { @@ -163,7 +164,7 @@ p.wp-embed-heading { .wp-embed-meta a:hover { text-decoration: none; - color: #2271b1; + color: #135e96; } .wp-embed-comments a { diff --git a/src/wp-includes/embed.php b/src/wp-includes/embed.php index b5b30acead..c38a079003 100644 --- a/src/wp-includes/embed.php +++ b/src/wp-includes/embed.php @@ -765,7 +765,7 @@ function wp_oembed_ensure_format( $format ) { * @param WP_HTTP_Response $result Result to send to the client. Usually a `WP_REST_Response`. * @param WP_REST_Request $request Request used to generate the response. * @param WP_REST_Server $server Server instance. - * @return true + * @return bool True if the request was served, false otherwise. */ function _oembed_rest_pre_serve_request( $served, $result, $request, $server ) { $params = $request->get_params(); @@ -843,10 +843,10 @@ function _oembed_create_xml( $data, $node = null ) { * * @since 5.2.0 * - * @param string $result The oEmbed HTML result. - * @param object $data A data object result from an oEmbed provider. - * @param string $url The URL of the content to be embedded. - * @return string The filtered oEmbed result. + * @param string|false $result The oEmbed HTML result. + * @param object $data A data object result from an oEmbed provider. + * @param string $url The URL of the content to be embedded. + * @return string|false The filtered oEmbed result. */ function wp_filter_oembed_iframe_title_attribute( $result, $data, $url ) { if ( false === $result || ! in_array( $data->type, array( 'rich', 'video' ), true ) ) { @@ -910,10 +910,10 @@ function wp_filter_oembed_iframe_title_attribute( $result, $data, $url ) { * * @since 4.4.0 * - * @param string $result The oEmbed HTML result. - * @param object $data A data object result from an oEmbed provider. - * @param string $url The URL of the content to be embedded. - * @return string The filtered and sanitized oEmbed result. + * @param string|false $result The oEmbed HTML result. + * @param object $data A data object result from an oEmbed provider. + * @param string $url The URL of the content to be embedded. + * @return string|false The filtered and sanitized oEmbed result. */ function wp_filter_oembed_result( $result, $data, $url ) { if ( false === $result || ! in_array( $data->type, array( 'rich', 'video' ), true ) ) { diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index 744eefeb82..234d71a2a1 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -2035,7 +2035,17 @@ function sanitize_file_name( $filename ) { } if ( $utf8_pcre ) { - $filename = preg_replace( "#\x{00a0}#siu", ' ', $filename ); + /** + * Replace all whitespace characters with a basic space (U+0020). + * + * The “Zs” in the pattern selects characters in the `Space_Separator` + * category, which is what Unicode considers space characters. + * + * @see https://www.unicode.org/reports/tr44/#General_Category_Values + * @see https://www.unicode.org/versions/Unicode16.0.0/core-spec/chapter-6/#G17548 + * @see https://www.php.net/manual/en/regexp.reference.unicode.php + */ + $filename = preg_replace( '#\p{Zs}#siu', ' ', $filename ); } /** @@ -2551,6 +2561,11 @@ function balanceTags( $text, $force = false ) { // phpcs:ignore WordPress.Namin /** * Balances tags of string using a modified stack. * + * {@internal Modified by Scott Reilly (coffee2code) 02 Aug 2004 + * 1.1 Fixed handling of append/stack pop order of end text + * Added Cleaning Hooks + * 1.0 First Version} + * * @since 2.0.4 * @since 5.3.0 Improve accuracy and add support for custom element tags. * @@ -2559,10 +2574,6 @@ function balanceTags( $text, $force = false ) { // phpcs:ignore WordPress.Namin * @copyright November 4, 2001 * @version 1.1 * @todo Make better - change loop condition to $text in 1.2 - * @internal Modified by Scott Reilly (coffee2code) 02 Aug 2004 - * 1.1 Fixed handling of append/stack pop order of end text - * Added Cleaning Hooks - * 1.0 First Version * * @param string $text Text to be balanced. * @return string Balanced text. diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index 3a965a2d3d..09d344dd1e 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -2289,7 +2289,6 @@ function get_calendar( $args = array() ) { * @type bool $display Whether to display the calendar output. Default true. * @type string $post_type Optional. Post type. Default 'post'. * } - * @return array The arguments for the `get_calendar` function. */ $args = apply_filters( 'get_calendar_args', wp_parse_args( $args, $defaults ) ); @@ -2494,7 +2493,7 @@ function get_calendar( $args = array() ) { $daysinmonth = (int) gmdate( 't', $unixmonth ); for ( $day = 1; $day <= $daysinmonth; ++$day ) { - if ( isset( $newrow ) && $newrow ) { + if ( $newrow ) { $calendar_output .= "\n\t</tr>\n\t<tr>\n\t\t"; } diff --git a/src/wp-includes/kses.php b/src/wp-includes/kses.php index ebb4a761b1..28bbce222a 100644 --- a/src/wp-includes/kses.php +++ b/src/wp-includes/kses.php @@ -2083,18 +2083,38 @@ function wp_kses_normalize_entities3( $matches ) { /** * Determines if a Unicode codepoint is valid. * + * The definition of a valid Unicode codepoint is taken from the XML definition: + * + * > Characters + * > + * > … + * > Legal characters are tab, carriage return, line feed, and the legal characters of + * > Unicode and ISO/IEC 10646. + * > … + * > Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] + * * @since 2.7.0 * + * @see https://www.w3.org/TR/xml/#charsets + * * @param int $i Unicode codepoint. * @return bool Whether or not the codepoint is a valid Unicode codepoint. */ function valid_unicode( $i ) { $i = (int) $i; - return ( 0x9 === $i || 0xa === $i || 0xd === $i || - ( 0x20 <= $i && $i <= 0xd7ff ) || - ( 0xe000 <= $i && $i <= 0xfffd ) || - ( 0x10000 <= $i && $i <= 0x10ffff ) + return ( + 0x9 === $i || // U+0009 HORIZONTAL TABULATION (HT) + 0xA === $i || // U+000A LINE FEED (LF) + 0xD === $i || // U+000D CARRIAGE RETURN (CR) + /* + * The valid Unicode characters according to the XML specification: + * + * > any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. + */ + ( 0x20 <= $i && $i <= 0xD7FF ) || + ( 0xE000 <= $i && $i <= 0xFFFD ) || + ( 0x10000 <= $i && $i <= 0x10FFFF ) ); } diff --git a/src/wp-includes/link-template.php b/src/wp-includes/link-template.php index 3e02c17853..cf41630c4a 100644 --- a/src/wp-includes/link-template.php +++ b/src/wp-includes/link-template.php @@ -4298,6 +4298,8 @@ function the_shortlink( $text = '', $title = '', $before = '', $after = '' ) { * - 'monsterid' (a monster) * - 'wavatar' (a cartoon face) * - 'identicon' (the "quilt", a geometric pattern) + * - 'initials' (initials based avatar with background color) + * - 'color' (generated background color) * - 'mystery', 'mm', or 'mysteryman' (The Oyster Man) * - 'blank' (transparent GIF) * - 'gravatar_default' (the Gravatar logo) @@ -4366,6 +4368,8 @@ function is_avatar_comment_type( $comment_type ) { * - 'monsterid' (a monster) * - 'wavatar' (a cartoon face) * - 'identicon' (the "quilt", a geometric pattern) + * - 'initials' (initials based avatar with background color) + * - 'color' (generated background color) * - 'mystery', 'mm', or 'mysteryman' (The Oyster Man) * - 'blank' (transparent GIF) * - 'gravatar_default' (the Gravatar logo) @@ -4545,6 +4549,33 @@ function get_avatar_data( $id_or_email, $args = null ) { 'r' => $args['rating'], ); + // Handle additional parameters for the 'initials' avatar type + if ( 'initials' === $args['default'] ) { + $name = ''; + + if ( $user ) { + $name = ! empty( $user->display_name ) ? $user->display_name : + ( ! empty( $user->first_name ) && ! empty( $user->last_name ) ? + $user->first_name . ' ' . $user->last_name : $user->user_login ); + } elseif ( is_object( $id_or_email ) && isset( $id_or_email->comment_author ) ) { + $name = $id_or_email->comment_author; + } elseif ( is_string( $id_or_email ) && false !== strpos( $id_or_email, '@' ) ) { + $name = str_replace( array( '.', '_', '-' ), ' ', substr( $id_or_email, 0, strpos( $id_or_email, '@' ) ) ); + } + + if ( ! empty( $name ) ) { + if ( preg_match( '/\p{Han}|\p{Hiragana}|\p{Katakana}|\p{Hangul}/u', $name ) || false === strpos( $name, ' ' ) ) { + $initials = mb_substr( $name, 0, min( 2, mb_strlen( $name, 'UTF-8' ) ), 'UTF-8' ); + } else { + $first = mb_substr( $name, 0, 1, 'UTF-8' ); + $last = mb_substr( $name, strrpos( $name, ' ' ) + 1, 1, 'UTF-8' ); + $initials = $first . $last; + } + + $url_args['initials'] = $initials; + } + } + /* * Gravatars are always served over HTTPS. * diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php index 0526cb175d..e51c322908 100644 --- a/src/wp-includes/load.php +++ b/src/wp-includes/load.php @@ -139,15 +139,18 @@ function wp_populate_basic_auth_from_authorization_header() { } /** - * Checks for the required PHP version, and the mysqli extension or - * a database drop-in. + * Checks the server requirements. + * + * - PHP version + * - PHP extensions + * - MySQL or MariaDB version (unless a database drop-in is present) * * Dies if requirements are not met. * * @since 3.0.0 * @access private * - * @global string $required_php_version The required PHP version string. + * @global string $required_php_version The minimum required PHP version string. * @global string[] $required_php_extensions The names of required PHP extensions. * @global string $wp_version The WordPress version string. */ diff --git a/src/wp-includes/media-template.php b/src/wp-includes/media-template.php index 86fe200f8d..4e7592bd74 100644 --- a/src/wp-includes/media-template.php +++ b/src/wp-includes/media-template.php @@ -443,7 +443,7 @@ function wp_print_media_templates() { ?> </h2> <div class="uploaded"><strong><?php _e( 'Uploaded on:' ); ?></strong> {{ data.dateFormatted }}</div> - <div class="uploaded-by"> + <div class="uploaded-by word-wrap-break-word"> <strong><?php _e( 'Uploaded by:' ); ?></strong> <# if ( data.authorLink ) { #> <a href="{{ data.authorLink }}">{{ data.authorName }}</a> @@ -605,7 +605,7 @@ function wp_print_media_templates() { <div class="centered"> <# if ( data.image && data.image.src && data.image.src !== data.icon ) { #> <img src="{{ data.image.src }}" class="thumbnail" draggable="false" alt="" /> - <# } else if ( data.sizes ) { + <# } else if ( data.sizes ) { if ( data.sizes.medium ) { #> <img src="{{ data.sizes.medium.url }}" class="thumbnail" draggable="false" alt="" /> <# } else { #> diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php index da46ef90a7..ef3610c56f 100644 --- a/src/wp-includes/media.php +++ b/src/wp-includes/media.php @@ -1070,7 +1070,6 @@ function wp_get_attachment_image( $attachment_id, $size = 'thumbnail', $icon = f list( $src, $width, $height ) = $image; $attachment = get_post( $attachment_id ); - $hwstring = image_hwstring( $width, $height ); $size_class = $size; if ( is_array( $size_class ) ) { @@ -1090,15 +1089,14 @@ function wp_get_attachment_image( $attachment_id, $size = 'thumbnail', $icon = f * * @param string $context The context. Default 'wp_get_attachment_image'. */ - $context = apply_filters( 'wp_get_attachment_image_context', 'wp_get_attachment_image' ); - $attr = wp_parse_args( $attr, $default_attr ); + $context = apply_filters( 'wp_get_attachment_image_context', 'wp_get_attachment_image' ); + $attr = wp_parse_args( $attr, $default_attr ); + $attr['width'] = $width; + $attr['height'] = $height; - $loading_attr = $attr; - $loading_attr['width'] = $width; - $loading_attr['height'] = $height; $loading_optimization_attr = wp_get_loading_optimization_attributes( 'img', - $loading_attr, + $attr, $context ); @@ -1169,8 +1167,16 @@ function wp_get_attachment_image( $attachment_id, $size = 'thumbnail', $icon = f */ $attr = apply_filters( 'wp_get_attachment_image_attributes', $attr, $attachment, $size ); - $attr = array_map( 'esc_attr', $attr ); - $html = rtrim( "<img $hwstring" ); + if ( isset( $attr['height'] ) && is_numeric( $attr['height'] ) ) { + $height = absint( $attr['height'] ); + } + if ( isset( $attr['width'] ) && is_numeric( $attr['width'] ) ) { + $width = absint( $attr['width'] ); + } + unset( $attr['height'], $attr['width'] ); + $attr = array_map( 'esc_attr', $attr ); + $hwstring = image_hwstring( $width, $height ); + $html = rtrim( "<img $hwstring" ); foreach ( $attr as $name => $value ) { $html .= " $name=" . '"' . $value . '"'; @@ -2992,9 +2998,6 @@ function wp_underscore_playlist_templates() { function wp_playlist_scripts( $type ) { wp_enqueue_style( 'wp-mediaelement' ); wp_enqueue_script( 'wp-playlist' ); - ?> -<!--[if lt IE 9]><script>document.createElement('<?php echo esc_js( $type ); ?>');</script><![endif]--> - <?php add_action( 'wp_footer', 'wp_underscore_playlist_templates', 0 ); add_action( 'admin_footer', 'wp_underscore_playlist_templates', 0 ); } @@ -3502,14 +3505,7 @@ function wp_audio_shortcode( $attr, $content = '' ) { } } - $html = ''; - - if ( 'mediaelement' === $library && 1 === $instance ) { - $html .= "<!--[if lt IE 9]><script>document.createElement('audio');</script><![endif]-->\n"; - } - - $html .= sprintf( '<audio %s controls="controls">', implode( ' ', $attr_strings ) ); - + $html = sprintf( '<audio %s controls="controls">', implode( ' ', $attr_strings ) ); $fileurl = ''; $source = '<source type="%s" src="%s" />'; @@ -3787,14 +3783,7 @@ function wp_video_shortcode( $attr, $content = '' ) { } } - $html = ''; - - if ( 'mediaelement' === $library && 1 === $instance ) { - $html .= "<!--[if lt IE 9]><script>document.createElement('video');</script><![endif]-->\n"; - } - - $html .= sprintf( '<video %s controls="controls">', implode( ' ', $attr_strings ) ); - + $html = sprintf( '<video %s controls="controls">', implode( ' ', $attr_strings ) ); $fileurl = ''; $source = '<source type="%s" src="%s" />'; diff --git a/src/wp-includes/meta.php b/src/wp-includes/meta.php index 6982e618c3..d60bf5e875 100644 --- a/src/wp-includes/meta.php +++ b/src/wp-includes/meta.php @@ -15,12 +15,14 @@ require ABSPATH . WPINC . '/class-wp-metadata-lazyloader.php'; /** * Adds metadata for the specified object. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 2.9.0 * * @global wpdb $wpdb WordPress database abstraction object. * - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param int $object_id ID of the object metadata is for. * @param string $meta_key Metadata key. * @param mixed $meta_value Metadata value. Arrays and objects are stored as serialized data and @@ -65,11 +67,12 @@ function add_metadata( $meta_type, $object_id, $meta_key, $meta_value, $unique = * Short-circuits adding metadata of a specific type. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * Returning a non-null value will effectively short-circuit the function. * * Possible hook names include: * + * - `add_blog_metadata` * - `add_post_metadata` * - `add_comment_metadata` * - `add_term_metadata` @@ -77,11 +80,12 @@ function add_metadata( $meta_type, $object_id, $meta_key, $meta_value, $unique = * * @since 3.1.0 * - * @param null|bool $check Whether to allow adding metadata for the given type. - * @param int $object_id ID of the object metadata is for. - * @param string $meta_key Metadata key. - * @param mixed $meta_value Metadata value. Must be serializable if non-scalar. - * @param bool $unique Whether the specified meta key should be unique for the object. + * @param null|int|false $check Whether to allow adding metadata for the given type. Return false or a meta ID + * to short-circuit the function. Return null to continue with the default behavior. + * @param int $object_id ID of the object metadata is for. + * @param string $meta_key Metadata key. + * @param mixed $meta_value Metadata value. Must be serializable if non-scalar. + * @param bool $unique Whether the specified meta key should be unique for the object. */ $check = apply_filters( "add_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $unique ); if ( null !== $check ) { @@ -105,10 +109,11 @@ function add_metadata( $meta_type, $object_id, $meta_key, $meta_value, $unique = * Fires immediately before meta of a specific type is added. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * * Possible hook names include: * + * - `add_blog_meta` * - `add_post_meta` * - `add_comment_meta` * - `add_term_meta` @@ -143,10 +148,11 @@ function add_metadata( $meta_type, $object_id, $meta_key, $meta_value, $unique = * Fires immediately after meta of a specific type is added. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * * Possible hook names include: * + * - `added_blog_meta` * - `added_post_meta` * - `added_comment_meta` * - `added_term_meta` @@ -168,12 +174,14 @@ function add_metadata( $meta_type, $object_id, $meta_key, $meta_value, $unique = * Updates metadata for the specified object. If no value already exists for the specified object * ID and metadata key, the metadata will be added. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 2.9.0 * * @global wpdb $wpdb WordPress database abstraction object. * - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param int $object_id ID of the object metadata is for. * @param string $meta_key Metadata key. * @param mixed $meta_value Metadata value. Must be serializable if non-scalar. @@ -218,11 +226,12 @@ function update_metadata( $meta_type, $object_id, $meta_key, $meta_value, $prev_ * Short-circuits updating metadata of a specific type. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * Returning a non-null value will effectively short-circuit the function. * * Possible hook names include: * + * - `update_blog_metadata` * - `update_post_metadata` * - `update_comment_metadata` * - `update_term_metadata` @@ -277,10 +286,11 @@ function update_metadata( $meta_type, $object_id, $meta_key, $meta_value, $prev_ * Fires immediately before updating metadata of a specific type. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * * Possible hook names include: * + * - `update_blog_meta` * - `update_post_meta` * - `update_comment_meta` * - `update_term_meta` @@ -323,10 +333,11 @@ function update_metadata( $meta_type, $object_id, $meta_key, $meta_value, $prev_ * Fires immediately after updating metadata of a specific type. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * * Possible hook names include: * + * - `updated_blog_meta` * - `updated_post_meta` * - `updated_comment_meta` * - `updated_term_meta` @@ -363,12 +374,14 @@ function update_metadata( $meta_type, $object_id, $meta_key, $meta_value, $prev_ /** * Deletes metadata for the specified object. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 2.9.0 * * @global wpdb $wpdb WordPress database abstraction object. * - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param int $object_id ID of the object metadata is for. * @param string $meta_key Metadata key. * @param mixed $meta_value Optional. Metadata value. Must be serializable if non-scalar. @@ -411,11 +424,12 @@ function delete_metadata( $meta_type, $object_id, $meta_key, $meta_value = '', $ * Short-circuits deleting metadata of a specific type. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * Returning a non-null value will effectively short-circuit the function. * * Possible hook names include: * + * - `delete_blog_metadata` * - `delete_post_metadata` * - `delete_comment_metadata` * - `delete_term_metadata` @@ -466,10 +480,11 @@ function delete_metadata( $meta_type, $object_id, $meta_key, $meta_value = '', $ * Fires immediately before deleting metadata of a specific type. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * * Possible hook names include: * + * - `delete_blog_meta` * - `delete_post_meta` * - `delete_comment_meta` * - `delete_term_meta` @@ -515,10 +530,11 @@ function delete_metadata( $meta_type, $object_id, $meta_key, $meta_value = '', $ * Fires immediately after deleting metadata of a specific type. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * * Possible hook names include: * + * - `deleted_blog_meta` * - `deleted_post_meta` * - `deleted_comment_meta` * - `deleted_term_meta` @@ -563,8 +579,8 @@ function delete_metadata( $meta_type, $object_id, $meta_key, $meta_value = '', $ * @see get_metadata_raw() * @see get_metadata_default() * - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param int $object_id ID of the object metadata is for. * @param string $meta_key Optional. Metadata key. If not specified, retrieve all metadata for * the specified object. Default empty string. @@ -596,8 +612,8 @@ function get_metadata( $meta_type, $object_id, $meta_key = '', $single = false ) * * @since 5.5.0 * - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param int $object_id ID of the object metadata is for. * @param string $meta_key Optional. Metadata key. If not specified, retrieve all metadata for * the specified object. Default empty string. @@ -623,11 +639,12 @@ function get_metadata_raw( $meta_type, $object_id, $meta_key = '', $single = fal * Short-circuits the return value of a meta field. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * Returning a non-null value will effectively short-circuit the function. * * Possible filter names include: * + * - `get_blog_metadata` * - `get_post_metadata` * - `get_comment_metadata` * - `get_term_metadata` @@ -641,8 +658,8 @@ function get_metadata_raw( $meta_type, $object_id, $meta_key = '', $single = fal * @param int $object_id ID of the object metadata is for. * @param string $meta_key Metadata key. * @param bool $single Whether to return only the first value of the specified `$meta_key`. - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. */ $check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, $single, $meta_type ); if ( null !== $check ) { @@ -687,8 +704,8 @@ function get_metadata_raw( $meta_type, $object_id, $meta_key = '', $single = fal * * @since 5.5.0 * - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param int $object_id ID of the object metadata is for. * @param string $meta_key Metadata key. * @param bool $single Optional. If true, return only the first value of the specified `$meta_key`. @@ -707,10 +724,11 @@ function get_metadata_default( $meta_type, $object_id, $meta_key, $single = fals * Filters the default metadata value for a specified meta key and object. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * * Possible filter names include: * + * - `default_blog_metadata` * - `default_post_metadata` * - `default_comment_metadata` * - `default_term_metadata` @@ -723,8 +741,8 @@ function get_metadata_default( $meta_type, $object_id, $meta_key, $single = fals * @param int $object_id ID of the object metadata is for. * @param string $meta_key Metadata key. * @param bool $single Whether to return only the first value of the specified `$meta_key`. - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. */ $value = apply_filters( "default_{$meta_type}_metadata", $value, $object_id, $meta_key, $single, $meta_type ); @@ -740,8 +758,8 @@ function get_metadata_default( $meta_type, $object_id, $meta_key, $single = fals * * @since 3.3.0 * - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param int $object_id ID of the object metadata is for. * @param string $meta_key Metadata key. * @return bool Whether a meta field with the given key exists. @@ -783,8 +801,8 @@ function metadata_exists( $meta_type, $object_id, $meta_key ) { * * @global wpdb $wpdb WordPress database abstraction object. * - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param int $meta_id ID for a specific meta row. * @return stdClass|false { * Metadata object, or boolean `false` if the metadata doesn't exist. @@ -793,6 +811,7 @@ function metadata_exists( $meta_type, $object_id, $meta_key ) { * @type mixed $meta_value The unserialized meta value. * @type string $meta_id Optional. The meta ID when the meta type is any value except 'user'. * @type string $umeta_id Optional. The meta ID when the meta type is 'user'. + * @type string $blog_id Optional. The object ID when the meta type is 'blog'. * @type string $post_id Optional. The object ID when the meta type is 'post'. * @type string $comment_id Optional. The object ID when the meta type is 'comment'. * @type string $term_id Optional. The object ID when the meta type is 'term'. @@ -820,11 +839,12 @@ function get_metadata_by_mid( $meta_type, $meta_id ) { * Short-circuits the return value when fetching a meta field by meta ID. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * Returning a non-null value will effectively short-circuit the function. * * Possible hook names include: * + * - `get_blog_metadata_by_mid` * - `get_post_metadata_by_mid` * - `get_comment_metadata_by_mid` * - `get_term_metadata_by_mid` @@ -862,8 +882,8 @@ function get_metadata_by_mid( $meta_type, $meta_id ) { * * @global wpdb $wpdb WordPress database abstraction object. * - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param int $meta_id ID for a specific meta row. * @param string $meta_value Metadata value. Must be serializable if non-scalar. * @param string|false $meta_key Optional. You can provide a meta key to update it. Default false. @@ -894,11 +914,12 @@ function update_metadata_by_mid( $meta_type, $meta_id, $meta_value, $meta_key = * Short-circuits updating metadata of a specific type by meta ID. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * Returning a non-null value will effectively short-circuit the function. * * Possible hook names include: * + * - `update_blog_metadata_by_mid` * - `update_post_metadata_by_mid` * - `update_comment_metadata_by_mid` * - `update_term_metadata_by_mid` @@ -988,8 +1009,8 @@ function update_metadata_by_mid( $meta_type, $meta_id, $meta_value, $meta_key = * * @global wpdb $wpdb WordPress database abstraction object. * - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param int $meta_id ID for a specific meta row. * @return bool True on successful delete, false on failure. */ @@ -1019,11 +1040,12 @@ function delete_metadata_by_mid( $meta_type, $meta_id ) { * Short-circuits deleting metadata of a specific type by meta ID. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * Returning a non-null value will effectively short-circuit the function. * * Possible hook names include: * + * - `delete_blog_metadata_by_mid` * - `delete_post_metadata_by_mid` * - `delete_comment_metadata_by_mid` * - `delete_term_metadata_by_mid` @@ -1059,8 +1081,6 @@ function delete_metadata_by_mid( $meta_type, $meta_id ) { * * - `delete_postmeta` * - `delete_commentmeta` - * - `delete_termmeta` - * - `delete_usermeta` * * @since 3.4.0 * @@ -1090,8 +1110,6 @@ function delete_metadata_by_mid( $meta_type, $meta_id ) { * * - `deleted_postmeta` * - `deleted_commentmeta` - * - `deleted_termmeta` - * - `deleted_usermeta` * * @since 3.4.0 * @@ -1115,8 +1133,8 @@ function delete_metadata_by_mid( $meta_type, $meta_id ) { * * @global wpdb $wpdb WordPress database abstraction object. * - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param string|int[] $object_ids Array or comma delimited list of object IDs to update cache for. * @return array|false Metadata cache for the specified objects, or false on failure. */ @@ -1145,11 +1163,12 @@ function update_meta_cache( $meta_type, $object_ids ) { * Short-circuits updating the metadata cache of a specific type. * * The dynamic portion of the hook name, `$meta_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * Returning a non-null value will effectively short-circuit the function. * * Possible hook names include: * + * - `update_blog_metadata_cache` * - `update_post_metadata_cache` * - `update_comment_metadata_cache` * - `update_term_metadata_cache` @@ -1268,8 +1287,8 @@ function get_meta_sql( $meta_query, $type, $primary_table, $primary_id_column, $ * * @global wpdb $wpdb WordPress database abstraction object. * - * @param string $type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @return string|false Metadata table name, or false if no metadata table exists */ function _get_meta_table( $type ) { @@ -1290,8 +1309,8 @@ function _get_meta_table( $type ) { * @since 3.1.3 * * @param string $meta_key Metadata key. - * @param string $meta_type Optional. Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. Default empty string. + * @param string $meta_type Optional. Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. Default empty string. * @return bool Whether the meta key is considered protected. */ function is_protected_meta( $meta_key, $meta_type = '' ) { @@ -1305,8 +1324,8 @@ function is_protected_meta( $meta_key, $meta_type = '' ) { * * @param bool $protected Whether the key is considered protected. * @param string $meta_key Metadata key. - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. */ return apply_filters( 'is_protected_meta', $protected, $meta_key, $meta_type ); } @@ -1319,8 +1338,8 @@ function is_protected_meta( $meta_key, $meta_type = '' ) { * * @param string $meta_key Metadata key. * @param mixed $meta_value Metadata value to sanitize. - * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param string $object_subtype Optional. The subtype of the object type. Default empty string. * @return mixed Sanitized $meta_value. */ @@ -1331,15 +1350,15 @@ function sanitize_meta( $meta_key, $meta_value, $object_type, $object_subtype = * Filters the sanitization of a specific meta key of a specific meta type and subtype. * * The dynamic portions of the hook name, `$object_type`, `$meta_key`, - * and `$object_subtype`, refer to the metadata object type (comment, post, term, or user), + * and `$object_subtype`, refer to the metadata object type (blog, comment, post, term, or user), * the meta key value, and the object subtype respectively. * * @since 4.9.8 * * @param mixed $meta_value Metadata value to sanitize. * @param string $meta_key Metadata key. - * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param string $object_subtype Object subtype. */ return apply_filters( "sanitize_{$object_type}_meta_{$meta_key}_for_{$object_subtype}", $meta_value, $meta_key, $object_type, $object_subtype ); @@ -1349,15 +1368,15 @@ function sanitize_meta( $meta_key, $meta_value, $object_type, $object_subtype = * Filters the sanitization of a specific meta key of a specific meta type. * * The dynamic portions of the hook name, `$meta_type`, and `$meta_key`, - * refer to the metadata object type (comment, post, term, or user) and the meta + * refer to the metadata object type (blog, comment, post, term, or user) and the meta * key value, respectively. * * @since 3.3.0 * * @param mixed $meta_value Metadata value to sanitize. * @param string $meta_key Metadata key. - * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. */ return apply_filters( "sanitize_{$object_type}_meta_{$meta_key}", $meta_value, $meta_key, $object_type ); } @@ -1369,7 +1388,7 @@ function sanitize_meta( $meta_key, $meta_value, $object_type, $object_subtype = * an object subtype is omitted, the meta key will be registered for the entire object type, however it can be partly * overridden in case a more specific meta key of the same name exists for the same object type and a subtype. * - * If an object type does not support any subtypes, such as users or comments, you should commonly call this function + * If an object type does not support any subtypes, such as blogs, users, or comments, you should commonly call this function * without passing a subtype. * * @since 3.3.0 @@ -1382,8 +1401,8 @@ function sanitize_meta( $meta_key, $meta_value, $object_type, $object_subtype = * @since 6.4.0 The `$revisions_enabled` argument was added to the arguments array. * @since 6.7.0 The `label` argument was added to the arguments array. * - * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param string $meta_key Meta key to register. * @param array $args { * Data used to describe the meta key when registered. @@ -1461,8 +1480,8 @@ function register_meta( $object_type, $meta_key, $args, $deprecated = null ) { * * @param array $args Array of meta registration arguments. * @param array $defaults Array of default arguments. - * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param string $meta_key Meta key. */ $args = apply_filters( 'register_meta_args', $args, $defaults, $object_type, $meta_key ); @@ -1557,8 +1576,8 @@ function register_meta( $object_type, $meta_key, $args, $deprecated = null ) { * @param string $meta_key Metadata key. * @param bool $single If true, return only the first value of the specified `$meta_key`. * This parameter has no effect if `$meta_key` is not specified. - * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $meta_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @return mixed An array of default values if `$single` is false. * The default value of the meta field if `$single` is true. */ @@ -1612,8 +1631,8 @@ function filter_default_metadata( $value, $object_id, $meta_key, $single, $meta_ * @since 4.6.0 * @since 4.9.8 The `$object_subtype` parameter was added. * - * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param string $meta_key Metadata key. * @param string $object_subtype Optional. The subtype of the object type. Default empty string. * @return bool True if the meta key is registered to the object type and, if provided, @@ -1631,8 +1650,8 @@ function registered_meta_key_exists( $object_type, $meta_key, $object_subtype = * @since 4.6.0 * @since 4.9.8 The `$object_subtype` parameter was added. * - * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param string $meta_key Metadata key. * @param string $object_subtype Optional. The subtype of the object type. Default empty string. * @return bool True if successful. False if the meta key was not registered. @@ -1681,8 +1700,8 @@ function unregister_meta_key( $object_type, $meta_key, $object_subtype = '' ) { * @since 4.6.0 * @since 4.9.8 The `$object_subtype` parameter was added. * - * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param string $object_subtype Optional. The subtype of the object type. Default empty string. * @return array[] List of registered metadata args, keyed by their meta keys. */ @@ -1704,8 +1723,8 @@ function get_registered_meta_keys( $object_type, $object_subtype = '' ) { * * @since 4.6.0 * - * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param int $object_id ID of the object the metadata is for. * @param string $meta_key Optional. Registered metadata key. If not specified, retrieve all registered * metadata for the specified object. @@ -1767,8 +1786,8 @@ function _wp_register_meta_args_allowed_list( $args, $default_args ) { * * @since 4.9.8 * - * @param string $object_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', - * or any other object type with an associated meta table. + * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', + * 'user', or any other object type with an associated meta table. * @param int $object_id ID of the object to retrieve its subtype. * @return string The object subtype or an empty string if unspecified subtype. */ @@ -1814,13 +1833,14 @@ function get_object_subtype( $object_type, $object_id ) { } /** - * Filters the object subtype identifier for a non-standard object type. + * Filters the object subtype identifier. * * The dynamic portion of the hook name, `$object_type`, refers to the meta object type - * (post, comment, term, user, or any other type with an associated meta table). + * (blog, post, comment, term, user, or any other type with an associated meta table). * * Possible hook names include: * + * - `get_object_subtype_blog` * - `get_object_subtype_post` * - `get_object_subtype_comment` * - `get_object_subtype_term` @@ -1828,7 +1848,7 @@ function get_object_subtype( $object_type, $object_id ) { * * @since 4.9.8 * - * @param string $object_subtype Empty string to override. + * @param string $object_subtype Object subtype or empty string to override. * @param int $object_id ID of the object to get the subtype for. */ return apply_filters( "get_object_subtype_{$object_type}", $object_subtype, $object_id ); diff --git a/src/wp-includes/ms-load.php b/src/wp-includes/ms-load.php index 0708bc4dcd..b8d5228d09 100644 --- a/src/wp-includes/ms-load.php +++ b/src/wp-includes/ms-load.php @@ -129,9 +129,9 @@ function ms_site_check() { /** * Retrieves the closest matching network for a domain and path. * - * @since 3.9.0 + * {@internal In 4.4.0, converted to a wrapper for WP_Network::get_by_path()} * - * @internal In 4.4.0, converted to a wrapper for WP_Network::get_by_path() + * @since 3.9.0 * * @param string $domain Domain to check. * @param string $path Path to check. @@ -552,12 +552,12 @@ function wpmu_current_site() { /** * Retrieves an object containing information about the requested network. * + * {@internal In 4.6.0, converted to use get_network()} + * * @since 3.9.0 * @deprecated 4.7.0 Use get_network() * @see get_network() * - * @internal In 4.6.0, converted to use get_network() - * * @param object|int $network The network's database row or ID. * @return WP_Network|false Object containing network information if found, false if not. */ diff --git a/src/wp-includes/ms-site.php b/src/wp-includes/ms-site.php index 2a2b1474c5..0058d1a482 100644 --- a/src/wp-includes/ms-site.php +++ b/src/wp-includes/ms-site.php @@ -1022,6 +1022,8 @@ function clean_blog_cache( $blog ) { /** * Adds metadata to a site. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 5.1.0 * * @param int $site_id Site ID. @@ -1048,6 +1050,8 @@ function add_site_meta( $site_id, $meta_key, $meta_value, $unique = false ) { * value, will keep from removing duplicate metadata with the same key. It also * allows removing all metadata matching key, if needed. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 5.1.0 * * @param int $site_id Site ID. @@ -1090,11 +1094,13 @@ function get_site_meta( $site_id, $key = '', $single = false ) { /** * Updates metadata for a site. * - * Use the $prev_value parameter to differentiate between meta fields with the + * Use the `$prev_value` parameter to differentiate between meta fields with the * same key and site ID. * * If the meta field for the site does not exist, it will be added. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 5.1.0 * * @param int $site_id Site ID. @@ -1237,7 +1243,7 @@ function wp_maybe_transition_site_statuses_on_update( $new_site, $old_site = nul if ( '1' === $new_site->deleted ) { /** - * Fires when the 'deleted' status is added to a site. + * Fires when the 'flagged for deletion' status is added to a site. * * @since 3.5.0 * @@ -1247,7 +1253,7 @@ function wp_maybe_transition_site_statuses_on_update( $new_site, $old_site = nul } else { /** - * Fires when the 'deleted' status is removed from a site. + * Fires when the 'flagged for deletion' status is removed from a site. * * @since 3.5.0 * diff --git a/src/wp-includes/option.php b/src/wp-includes/option.php index 9760304efc..3b4f461724 100644 --- a/src/wp-includes/option.php +++ b/src/wp-includes/option.php @@ -1880,7 +1880,7 @@ function wp_set_all_user_settings( $user_settings ) { } if ( ! is_user_member_of_blog() ) { - return; + return null; } $settings = ''; @@ -3176,7 +3176,23 @@ function unregister_setting( $option_group, $option_name, $deprecated = '' ) { * * @global array $wp_registered_settings * - * @return array List of registered settings, keyed by option name. + * @return array { + * List of registered settings, keyed by option name. + * + * @type array ...$0 { + * Data used to describe the setting when registered. + * + * @type string $type The type of data associated with this setting. + * Valid values are 'string', 'boolean', 'integer', 'number', 'array', and 'object'. + * @type string $label A label of the data attached to this setting. + * @type string $description A description of the data attached to this setting. + * @type callable $sanitize_callback A callback function that sanitizes the option's value. + * @type bool|array $show_in_rest Whether data associated with this setting should be included in the REST API. + * When registering complex settings, this argument may optionally be an + * array with a 'schema' key. + * @type mixed $default Default value when calling `get_option()`. + * } + * } */ function get_registered_settings() { global $wp_registered_settings; diff --git a/src/wp-includes/pluggable.php b/src/wp-includes/pluggable.php index e7ce2edb41..1dbac5e1d7 100644 --- a/src/wp-includes/pluggable.php +++ b/src/wp-includes/pluggable.php @@ -446,10 +446,10 @@ if ( ! function_exists( 'wp_mail' ) ) : $phpmailer->addAddress( $address, $recipient_name ); break; case 'cc': - $phpmailer->addCc( $address, $recipient_name ); + $phpmailer->addCC( $address, $recipient_name ); break; case 'bcc': - $phpmailer->addBcc( $address, $recipient_name ); + $phpmailer->addBCC( $address, $recipient_name ); break; case 'reply_to': $phpmailer->addReplyTo( $address, $recipient_name ); @@ -2676,9 +2676,11 @@ if ( ! function_exists( 'wp_hash_password' ) ) : * - `PASSWORD_ARGON2ID` * - `PASSWORD_DEFAULT` * + * The values of the algorithm constants are strings in PHP 7.4+ and integers in PHP 7.3 and earlier. + * * @since 6.8.0 * - * @param string $algorithm The hashing algorithm. Default is the value of the `PASSWORD_BCRYPT` constant. + * @param string|int $algorithm The hashing algorithm. Default is the value of the `PASSWORD_BCRYPT` constant. */ $algorithm = apply_filters( 'wp_hash_password_algorithm', PASSWORD_BCRYPT ); @@ -2688,12 +2690,14 @@ if ( ! function_exists( 'wp_hash_password' ) ) : * The default hashing algorithm is bcrypt, but this can be changed via the {@see 'wp_hash_password_algorithm'} * filter. You must ensure that the options are appropriate for the algorithm in use. * + * The values of the algorithm constants are strings in PHP 7.4+ and integers in PHP 7.3 and earlier. + * * @since 6.8.0 * - * @param array $options Array of options to pass to the password hashing functions. - * By default this is an empty array which means the default - * options will be used. - * @param string $algorithm The hashing algorithm in use. + * @param array $options Array of options to pass to the password hashing functions. + * By default this is an empty array which means the default + * options will be used. + * @param string|int $algorithm The hashing algorithm in use. */ $options = apply_filters( 'wp_hash_password_options', array(), $algorithm ); @@ -3048,6 +3052,8 @@ if ( ! function_exists( 'get_avatar' ) ) : * - 'monsterid' (a monster) * - 'wavatar' (a cartoon face) * - 'identicon' (the "quilt", a geometric pattern) + * - 'initials' (initials based avatar with background color) + * - 'color' (generated background color) * - 'mystery', 'mm', or 'mysteryman' (The Oyster Man) * - 'blank' (transparent GIF) * - 'gravatar_default' (the Gravatar logo) diff --git a/src/wp-includes/plugin.php b/src/wp-includes/plugin.php index bed67a9d96..5b4079b0bd 100644 --- a/src/wp-includes/plugin.php +++ b/src/wp-includes/plugin.php @@ -359,7 +359,7 @@ function remove_all_filters( $hook_name, $priority = false ) { * * @global string[] $wp_current_filter Stores the list of current filters with the current one last * - * @return string Hook name of the current filter. + * @return string|false Hook name of the current filter, false if no filter is running. */ function current_filter() { global $wp_current_filter; @@ -632,7 +632,7 @@ function remove_all_actions( $hook_name, $priority = false ) { * * @since 3.9.0 * - * @return string Hook name of the current action. + * @return string|false Hook name of the current action, false if no action is running. */ function current_action() { return current_filter(); diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index 62960a6b0f..d9efb1e06a 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -1906,7 +1906,7 @@ function unregister_post_type( $post_type ) { * Otherwise, an 's' will be added to the value for the plural form. After * registration, capability_type will always be a string of the singular value. * - * By default, eight keys are accepted as part of the capabilities array: + * By default, the following keys are accepted as part of the capabilities array: * * - edit_post, read_post, and delete_post are meta capabilities, which are then * generally mapped to corresponding primitive capabilities depending on the @@ -1921,8 +1921,9 @@ function unregister_post_type( $post_type ) { * - delete_posts - Controls whether objects of this post type can be deleted. * - publish_posts - Controls publishing objects of this post type. * - read_private_posts - Controls whether private objects can be read. + * - create_posts - Controls whether objects of this post type can be created. * - * These five primitive capabilities are checked in core in various locations. + * These primitive capabilities are checked in core in various locations. * There are also six other primitive capabilities which are not referenced * directly in core, except in map_meta_cap(), which takes the three aforementioned * meta capabilities and translates them into one or more primitive capabilities @@ -1948,7 +1949,25 @@ function unregister_post_type( $post_type ) { * @see map_meta_cap() * * @param object $args Post type registration arguments. - * @return object Object with all the capabilities as member variables. + * @return object { + * Object with all the capabilities as member variables. + * + * @type string $edit_post Capability to edit a post. + * @type string $read_post Capability to read a post. + * @type string $delete_post Capability to delete a post. + * @type string $edit_posts Capability to edit posts. + * @type string $edit_others_posts Capability to edit others' posts. + * @type string $delete_posts Capability to delete posts. + * @type string $publish_posts Capability to publish posts. + * @type string $read_private_posts Capability to read private posts. + * @type string $create_posts Capability to create posts. + * @type string $read Optional. Capability to read a post. + * @type string $delete_private_posts Optional. Capability to delete private posts. + * @type string $delete_published_posts Optional. Capability to delete published posts. + * @type string $delete_others_posts Optional. Capability to delete others' posts. + * @type string $edit_private_posts Optional. Capability to edit private posts. + * @type string $edit_published_posts Optional. Capability to edit published posts. + * } */ function get_post_type_capabilities( $args ) { if ( ! is_array( $args->capability_type ) ) { @@ -2589,6 +2608,8 @@ function get_posts( $args = null ) { * * Post meta data is called "Custom Fields" on the Administration Screen. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 1.5.0 * * @param int $post_id Post ID. @@ -2621,6 +2642,8 @@ function add_post_meta( $post_id, $meta_key, $meta_value, $unique = false ) { * value, will keep from removing duplicate metadata with the same key. It also * allows removing all metadata matching the key, if needed. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 1.5.0 * * @param int $post_id Post ID. @@ -2676,6 +2699,8 @@ function get_post_meta( $post_id, $key = '', $single = false ) { * * Can be used in place of add_post_meta(). * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 1.5.0 * * @param int $post_id Post ID. @@ -4623,7 +4648,7 @@ function wp_insert_post( $postarr, $wp_error = false, $fire_after_hooks = true ) if ( $update || '0000-00-00 00:00:00' === $post_date ) { $post_modified = current_time( 'mysql' ); - $post_modified_gmt = current_time( 'mysql', 1 ); + $post_modified_gmt = current_time( 'mysql', true ); } else { $post_modified = $post_date; $post_modified_gmt = $post_date_gmt; @@ -4849,6 +4874,15 @@ function wp_insert_post( $postarr, $wp_error = false, $fire_after_hooks = true ) } } + /** + * Fires immediately before a new post is inserted in the database. + * + * @since 6.9.0 + * + * @param array $data Array of unslashed post data. + */ + do_action( 'pre_post_insert', $data ); + if ( false === $wpdb->insert( $wpdb->posts, $data ) ) { if ( $wp_error ) { if ( 'attachment' === $post_type ) { @@ -6075,7 +6109,7 @@ function get_page_by_path( $page_path, $output = OBJECT, $post_type = 'page' ) { if ( false !== $cached ) { // Special case: '0' is a bad `$page_path`. if ( '0' === $cached || 0 === $cached ) { - return; + return null; } else { return get_post( $cached, $output ); } @@ -6843,7 +6877,9 @@ function wp_get_attachment_metadata( $attachment_id = 0, $unfiltered = false ) { * * @param int $attachment_id Attachment post ID. * @param array $data Attachment meta data. - * @return int|false False if $post is invalid. + * @return int|bool Whether the metadata was successfully updated. + * True on success, the Meta ID if the key didn't exist. + * False if $post is invalid, on failure, or if $data is the same as the existing metadata. */ function wp_update_attachment_metadata( $attachment_id, $data ) { $attachment_id = (int) $attachment_id; @@ -8134,6 +8170,10 @@ function wp_queue_posts_for_term_meta_lazyload( $posts ) { * @param WP_Post $post Post object. */ function _update_term_count_on_transition_post_status( $new_status, $old_status, $post ) { + if ( $new_status === $old_status ) { + return; + } + // Update counts for the post's terms. foreach ( (array) get_object_taxonomies( $post->post_type ) as $taxonomy ) { $tt_ids = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'tt_ids' ) ); diff --git a/src/wp-includes/rest-api/class-wp-rest-response.php b/src/wp-includes/rest-api/class-wp-rest-response.php index c6ea11be83..0861d190d0 100644 --- a/src/wp-includes/rest-api/class-wp-rest-response.php +++ b/src/wp-includes/rest-api/class-wp-rest-response.php @@ -43,7 +43,7 @@ class WP_REST_Response extends WP_HTTP_Response { /** * Adds a link to the response. * - * @internal The $rel parameter is first, as this looks nicer when sending multiple. + * {@internal The $rel parameter is first, as this looks nicer when sending multiple.} * * @since 4.4.0 * @@ -135,7 +135,7 @@ class WP_REST_Response extends WP_HTTP_Response { /** * Sets a single link header. * - * @internal The $rel parameter is first, as this looks nicer when sending multiple. + * {@internal The $rel parameter is first, as this looks nicer when sending multiple.} * * @since 4.4.0 * diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php index b0ac65a647..767917d6f6 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php @@ -802,7 +802,16 @@ class WP_REST_Application_Passwords_Controller extends WP_REST_Controller { 'app_id' => array( 'description' => __( 'A UUID provided by the application to uniquely identify it. It is recommended to use an UUID v5 with the URL or DNS namespace.' ), 'type' => 'string', - 'format' => 'uuid', + 'oneOf' => array( + array( + 'type' => 'string', + 'format' => 'uuid', + ), + array( + 'type' => 'string', + 'enum' => array( '' ), + ), + ), 'context' => array( 'view', 'edit', 'embed' ), ), 'name' => array( diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php index 4b960d6c6b..0474613b2e 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php @@ -662,11 +662,11 @@ abstract class WP_REST_Controller { /** * Sanitizes the slug value. * - * @since 4.7.0 - * - * @internal We can't use sanitize_title() directly, as the second + * {@internal We can't use sanitize_title() directly, as the second * parameter is the fallback title, which would end up being set to the - * request object. + * request object.} + * + * @since 4.7.0 * * @see https://github.com/WP-API/WP-API/issues/1585 * diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php index 51c1ac29b8..908ebe4bcc 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php @@ -88,7 +88,7 @@ class WP_REST_Global_Styles_Controller extends WP_REST_Posts_Controller { // Lists/updates a single global style variation based on the given id. register_rest_route( $this->namespace, - '/' . $this->rest_base . '/(?P<id>[\/\w-]+)', + '/' . $this->rest_base . '/(?P<id>[\/\d+]+)', array( array( 'methods' => WP_REST_Server::READABLE, @@ -96,9 +96,8 @@ class WP_REST_Global_Styles_Controller extends WP_REST_Posts_Controller { 'permission_callback' => array( $this, 'get_item_permissions_check' ), 'args' => array( 'id' => array( - 'description' => __( 'The id of a template' ), - 'type' => 'string', - 'sanitize_callback' => array( $this, '_sanitize_global_styles_callback' ), + 'description' => __( 'ID of global styles config.' ), + 'type' => 'integer', ), ), ), @@ -115,17 +114,17 @@ class WP_REST_Global_Styles_Controller extends WP_REST_Posts_Controller { } /** - * Sanitize the global styles ID or stylesheet to decode endpoint. + * Sanitize the global styles stylesheet to decode endpoint. * For example, `wp/v2/global-styles/twentytwentytwo%200.4.0` * would be decoded to `twentytwentytwo 0.4.0`. * * @since 5.9.0 * - * @param string $id_or_stylesheet Global styles ID or stylesheet. - * @return string Sanitized global styles ID or stylesheet. + * @param string $stylesheet Global styles stylesheet. + * @return string Sanitized global styles stylesheet. */ - public function _sanitize_global_styles_callback( $id_or_stylesheet ) { - return urldecode( $id_or_stylesheet ); + public function _sanitize_global_styles_callback( $stylesheet ) { + return urldecode( $stylesheet ); } /** @@ -139,7 +138,7 @@ class WP_REST_Global_Styles_Controller extends WP_REST_Posts_Controller { protected function get_post( $id ) { $error = new WP_Error( 'rest_global_styles_not_found', - __( 'No global styles config exist with that id.' ), + __( 'No global styles config exists with that ID.' ), array( 'status' => 404 ) ); @@ -464,7 +463,7 @@ class WP_REST_Global_Styles_Controller extends WP_REST_Posts_Controller { 'properties' => array( 'id' => array( 'description' => __( 'ID of global styles config.' ), - 'type' => 'string', + 'type' => 'integer', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php index 004f5851a2..f3c4295370 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php @@ -145,7 +145,19 @@ class WP_REST_Settings_Controller extends WP_REST_Controller { public function update_item( $request ) { $options = $this->get_registered_options(); - $params = $request->get_params(); + $params = array_diff_key( $request->get_params(), $request->get_query_params() ); + + if ( empty( $params ) || ! empty( array_diff_key( $params, $options ) ) ) { + $message = empty( $params ) + ? __( 'Request body cannot be empty.' ) + : __( 'Invalid parameter(s) provided.' ); + + return new WP_Error( + 'rest_invalid_param', + $message, + array( 'status' => 400 ) + ); + } foreach ( $options as $name => $args ) { if ( ! array_key_exists( $name, $params ) ) { diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index c82c620ffe..cd2c06e4cc 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -396,7 +396,7 @@ function wp_default_packages_inline_scripts( $scripts ) { "\n", array( '( function() {', - ' var userId = ' . get_current_user_ID() . ';', + ' var userId = ' . get_current_user_id() . ';', ' var storageKey = "WP_DATA_USER_" + userId;', ' wp.data', ' .use( wp.data.plugins.persistence, { storageKey: storageKey } );', @@ -997,8 +997,6 @@ function wp_default_scripts( $scripts ) { // Not used in core, replaced by imgAreaSelect. $scripts->add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.min.js', array( 'jquery' ), '0.9.15' ); - $scripts->add( 'swfobject', '/wp-includes/js/swfobject.js', array(), '2.2-20120417' ); - // Error messages for Plupload. $uploader_l10n = array( 'queue_limit_exceeded' => __( 'You have attempted to queue too many files.' ), @@ -1046,12 +1044,6 @@ function wp_default_scripts( $scripts ) { $scripts->add( 'wp-plupload', "/wp-includes/js/plupload/wp-plupload$suffix.js", array( 'plupload', 'jquery', 'json2', 'media-models' ), false, 1 ); did_action( 'init' ) && $scripts->localize( 'wp-plupload', 'pluploadL10n', $uploader_l10n ); - // Keep 'swfupload' for back-compat. - $scripts->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', array(), '2201-20110113' ); - $scripts->add( 'swfupload-all', false, array( 'swfupload' ), '2201' ); - $scripts->add( 'swfupload-handlers', "/wp-includes/js/swfupload/handlers$suffix.js", array( 'swfupload-all', 'jquery' ), '2201-20110524' ); - did_action( 'init' ) && $scripts->localize( 'swfupload-handlers', 'swfuploadL10n', $uploader_l10n ); - $scripts->add( 'comment-reply', "/wp-includes/js/comment-reply$suffix.js", array(), false, 1 ); did_action( 'init' ) && $scripts->add_data( 'comment-reply', 'strategy', 'async' ); @@ -1497,7 +1489,7 @@ function wp_default_scripts( $scripts ) { $scripts->add( 'wp-color-picker', "/wp-admin/js/color-picker$suffix.js", array( 'iris' ), false, 1 ); $scripts->set_translations( 'wp-color-picker' ); - $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox', 'wp-util', 'wp-a11y', 'wp-date' ), false, 1 ); + $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'common', 'jquery', 'admin-comments', 'postbox', 'wp-util', 'wp-a11y', 'wp-date' ), false, 1 ); $scripts->set_translations( 'dashboard' ); $scripts->add( 'list-revisions', "/wp-includes/js/wp-list-revisions$suffix.js" ); diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php index 3e235b780f..935212652c 100644 --- a/src/wp-includes/taxonomy.php +++ b/src/wp-includes/taxonomy.php @@ -1292,6 +1292,8 @@ function get_term_to_edit( $id, $taxonomy ) { * * Prior to 4.5.0, taxonomy was passed as the first parameter of `get_terms()`. * + * {@internal The `$deprecated` parameter is parsed for backward compatibility only.} + * * @since 2.3.0 * @since 4.2.0 Introduced 'name' and 'childless' parameters. * @since 4.4.0 Introduced the ability to pass 'term_id' as an alias of 'id' for the `orderby` parameter. @@ -1301,8 +1303,6 @@ function get_term_to_edit( $id, $taxonomy ) { * Introduced 'meta_key' and 'meta_value' parameters. Introduced the ability to order results by metadata. * @since 4.8.0 Introduced 'suppress_filter' parameter. * - * @internal The `$deprecated` parameter is parsed for backward compatibility only. - * * @param array|string $args Optional. Array or string of arguments. See WP_Term_Query::__construct() * for information on accepted arguments. Default empty array. * @param array|string $deprecated Optional. Argument array, when using the legacy function parameter format. @@ -1382,6 +1382,8 @@ function get_terms( $args = array(), $deprecated = '' ) { /** * Adds metadata to a term. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 4.4.0 * * @param int $term_id Term ID. @@ -1409,6 +1411,8 @@ function add_term_meta( $term_id, $meta_key, $meta_value, $unique = false ) { /** * Removes metadata matching criteria from a term. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 4.4.0 * * @param int $term_id Term ID. @@ -1455,6 +1459,8 @@ function get_term_meta( $term_id, $key = '', $single = false ) { * * If the meta field for the term does not exist, it will be added. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 4.4.0 * * @param int $term_id Term ID. @@ -1927,11 +1933,11 @@ function sanitize_term_field( $field, $value, $term_id, $taxonomy, $context ) { * * Default $args is 'hide_empty' which can be 'hide_empty=true' or array('hide_empty' => true). * + * {@internal The `$deprecated` parameter is parsed for backward compatibility only.} + * * @since 2.3.0 * @since 5.6.0 Changed the function signature so that the `$args` array can be provided as the first parameter. * - * @internal The `$deprecated` parameter is parsed for backward compatibility only. - * * @param array|string $args Optional. Array or string of arguments. See WP_Term_Query::__construct() * for information on accepted arguments. Default empty array. * @param array|string $deprecated Optional. Argument array, when using the legacy function parameter format. @@ -2137,11 +2143,11 @@ function wp_delete_term( $term, $taxonomy, $args = array() ) { ) ); - if ( 1 === count( $terms ) && isset( $default ) ) { + if ( 1 === count( $terms ) ) { $terms = array( $default ); } else { $terms = array_diff( $terms, array( $term ) ); - if ( isset( $default ) && isset( $force_default ) && $force_default ) { + if ( isset( $force_default ) && $force_default ) { $terms = array_merge( $terms, array( $default ) ); } } @@ -4892,11 +4898,13 @@ function is_object_in_term( $object_id, $taxonomy, $terms = null ) { if ( is_wp_error( $object_terms ) ) { return $object_terms; } + if ( empty( $object_terms ) ) { return false; } + if ( empty( $terms ) ) { - return ( ! empty( $object_terms ) ); + return true; } $terms = (array) $terms; diff --git a/src/wp-includes/theme.json b/src/wp-includes/theme.json index 641c379557..85836d6c24 100644 --- a/src/wp-includes/theme.json +++ b/src/wp-includes/theme.json @@ -65,7 +65,7 @@ "gradients": [ { "name": "Vivid cyan blue to vivid purple", - "gradient": "linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)", + "gradient": "linear-gradient(135deg,rgb(6,147,227) 0%,rgb(155,81,224) 100%)", "slug": "vivid-cyan-blue-to-vivid-purple" }, { @@ -75,12 +75,12 @@ }, { "name": "Luminous vivid amber to luminous vivid orange", - "gradient": "linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)", + "gradient": "linear-gradient(135deg,rgb(252,185,0) 0%,rgb(255,105,0) 100%)", "slug": "luminous-vivid-amber-to-luminous-vivid-orange" }, { "name": "Luminous vivid orange to vivid red", - "gradient": "linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)", + "gradient": "linear-gradient(135deg,rgb(255,105,0) 0%,rgb(207,46,46) 100%)", "slug": "luminous-vivid-orange-to-vivid-red" }, { @@ -251,12 +251,12 @@ { "name": "Outlined", "slug": "outlined", - "shadow": "6px 6px 0px -3px rgba(255, 255, 255, 1), 6px 6px rgba(0, 0, 0, 1)" + "shadow": "6px 6px 0px -3px rgb(255, 255, 255), 6px 6px rgb(0, 0, 0)" }, { "name": "Crisp", "slug": "crisp", - "shadow": "6px 6px 0px rgba(0, 0, 0, 1)" + "shadow": "6px 6px 0px rgb(0, 0, 0)" } ] }, diff --git a/src/wp-includes/theme.php b/src/wp-includes/theme.php index b4a71d855a..0727086aee 100644 --- a/src/wp-includes/theme.php +++ b/src/wp-includes/theme.php @@ -4349,6 +4349,8 @@ function create_initial_theme_features() { * * @since 5.9.0 * + * @global string[] $wp_theme_directories + * * @return bool Whether the active theme is a block-based theme or not. */ function wp_is_block_theme() { diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php index 1e15b4b0ce..60da3d2831 100644 --- a/src/wp-includes/user.php +++ b/src/wp-includes/user.php @@ -477,7 +477,7 @@ function wp_authenticate_application_password( */ do_action( 'wp_authenticate_application_password_errors', $error, $user, $item, $password ); - if ( is_wp_error( $error ) && $error->has_errors() ) { + if ( $error->has_errors() ) { /** This action is documented in wp-includes/user.php */ do_action( 'application_password_failed_authentication', $error ); @@ -637,7 +637,7 @@ function count_user_posts( $userid, $post_type = 'post', $public_only = false ) * @since 4.1.0 Added `$post_type` argument. * @since 4.3.1 Added `$public_only` argument. * - * @param int $count The user's post count. + * @param string $count The user's post count as a numeric string. * @param int $userid User ID. * @param string|array $post_type Single post type or array of post types to count the number of posts for. * @param bool $public_only Whether to limit counted posts to public posts. @@ -1126,7 +1126,7 @@ function get_blogs_of_user( $user_id, $all = false ) { * @param object[] $sites An array of site objects belonging to the user. * @param int $user_id User ID. * @param bool $all Whether the returned sites array should contain all sites, including - * those marked 'deleted', 'archived', or 'spam'. Default false. + * those flagged for deletion, archived, or marked as spam. */ return apply_filters( 'get_blogs_of_user', $sites, $user_id, $all ); } @@ -1202,6 +1202,8 @@ function is_user_member_of_blog( $user_id = 0, $blog_id = 0 ) { /** * Adds meta data to a user. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 3.0.0 * * @param int $user_id User ID. @@ -1228,6 +1230,8 @@ function add_user_meta( $user_id, $meta_key, $meta_value, $unique = false ) { * value, will keep from removing duplicate metadata with the same key. It also * allows removing all metadata matching key, if needed. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 3.0.0 * * @link https://developer.wordpress.org/reference/functions/delete_user_meta/ @@ -1279,6 +1283,8 @@ function get_user_meta( $user_id, $key = '', $single = false ) { * * If the meta field for the user does not exist, it will be added. * + * For historical reasons both the meta key and the meta value are expected to be "slashed" (slashes escaped) on input. + * * @since 3.0.0 * * @link https://developer.wordpress.org/reference/functions/update_user_meta/ @@ -2280,7 +2286,10 @@ function wp_insert_user( $userdata ) { */ $user_nicename = apply_filters( 'pre_user_nicename', $user_nicename ); - if ( mb_strlen( $user_nicename ) > 50 ) { + // Check if the sanitized nicename is empty. + if ( empty( $user_nicename ) ) { + return new WP_Error( 'empty_user_nicename', __( 'Cannot create a user with an empty nicename.' ) ); + } elseif ( mb_strlen( $user_nicename ) > 50 ) { return new WP_Error( 'user_nicename_too_long', __( 'Nicename may not be longer than 50 characters.' ) ); } @@ -3172,7 +3181,7 @@ function retrieve_password( $user_login = '' ) { $user_data = false; // Use the passed $user_login if available, otherwise use $_POST['user_login']. - if ( ! $user_login && ! empty( $_POST['user_login'] ) ) { + if ( ! $user_login && ! empty( $_POST['user_login'] ) && is_string( $_POST['user_login'] ) ) { $user_login = $_POST['user_login']; } diff --git a/src/wp-includes/version.php b/src/wp-includes/version.php index 324ee3279f..c7ee55fc6e 100644 --- a/src/wp-includes/version.php +++ b/src/wp-includes/version.php @@ -30,10 +30,10 @@ $wp_db_version = 58975; * * @global string $tinymce_version */ -$tinymce_version = '49110-20201110'; +$tinymce_version = '49110-20250317'; /** - * Holds the required PHP version. + * Holds the minimum required PHP version. * * @global string $required_php_version */ @@ -50,7 +50,7 @@ $required_php_extensions = array( ); /** - * Holds the required MySQL version. + * Holds the minimum required MySQL version. * * @global string $required_mysql_version */ diff --git a/src/wp-includes/widgets/class-wp-widget-media-gallery.php b/src/wp-includes/widgets/class-wp-widget-media-gallery.php index ecc446c221..a2527a6554 100644 --- a/src/wp-includes/widgets/class-wp-widget-media-gallery.php +++ b/src/wp-includes/widgets/class-wp-widget-media-gallery.php @@ -240,7 +240,6 @@ class WP_Widget_Media_Gallery extends WP_Widget_Media { * Whether the widget has content to show. * * @since 4.9.0 - * @access protected * * @param array $instance Widget instance props. * @return bool Whether widget has content. |