Make WordPress Core


Ignore:
Timestamp:
10/17/2022 05:46:39 PM (14 months ago)
Author:
audrasjb
Message:

Grouped backports to the 5.8 branch.

  • Editor: Bump @wordpress packages for the 5.9 branch,
  • Media: Refactor search by filename within the admin,
  • REST API: Lockdown post parameter of the terms endpoint,
  • Customize: Escape blogname option in underscores templates,
  • Query: Validate relation in WP_Date_Query,
  • Users: Revert use of shared objects for current user,
  • Posts, Post types: Apply KSES to post-by-email content,
  • General: Validate host on "Are you sure?" screen,
  • Posts, Post types: Remove emails from post-by-email logs,
  • Pings/trackbacks: Apply KSES to all trackbacks,
  • Mail: Reset PHPMailer properties between use,
  • Comments: Apply kses when editing comments,
  • Widgets: Escape RSS error messages for display.

Merges [54521-54530] to the 5.8 branch.
Props audrasjb, costdev, cu121, dd32, davidbaumwald, ehtis, johnbillion, johnjamesjacoby, martinkrcho, matveb, oztaser, paulkevan, peterwilsoncc, ravipatel, SergeyBiryukov, talldanwp, timothyblynjacobs, tykoted, voldemortensen, vortfu, xknown.

Location:
branches/5.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.8

  • branches/5.8/src/wp-includes/pluggable.php

    r50952 r54548  
    9292     * @since 2.8.0
    9393     * @since 4.4.0 Added 'ID' as an alias of 'id' for the `$field` parameter.
    94      * @since 5.8.0 Returns the global `$current_user` if it's the user being fetched.
    9594     *
    9695     * @global WP_User $current_user The current user object which holds the user data.
     
    101100     */
    102101    function get_user_by( $field, $value ) {
    103         global $current_user;
    104 
    105102        $userdata = WP_User::get_data_by( $field, $value );
    106103
    107104        if ( ! $userdata ) {
    108105            return false;
    109         }
    110 
    111         if ( $current_user instanceof WP_User && $current_user->ID === (int) $userdata->ID ) {
    112             return $current_user;
    113106        }
    114107
     
    362355        $phpmailer->clearCustomHeaders();
    363356        $phpmailer->clearReplyTos();
     357        $phpmailer->Body    = '';
     358        $phpmailer->AltBody = '';
    364359
    365360        // Set "From" name and email.
Note: See TracChangeset for help on using the changeset viewer.