Make WordPress Core


Ignore:
Timestamp:
10/12/2023 02:59:09 PM (14 months ago)
Author:
joemcgill
Message:

Grouped backports to the 6.0 branch.

  • REST API: Limit search_columns for users without list_users.
  • Comments: Prevent users who can not see a post from seeing comments on it.
  • Application Passwords: Prevent the use of some pseudo protocols in application passwords.
  • Restrict media shortcode ajax to certain type
  • REST API: Ensure no-cache headers are sent when methods are overriden.
  • Prevent unintended behavior when certain objects are unserialized.

Merges [56833], [56834], [56835], [56836], [56837], and [56838] to the 6.0 branch.
Props xknown, jorbin, Vortfu, joehoyle, timothyblynjacobs, peterwilsoncc, ehtis, tykoted, martinkrcho, paulkevan, dd32, antpb, rmccue.

Location:
branches/6.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.0

  • branches/6.0/src/wp-includes/class-wp-theme.php

    r53417 r56870  
    715715
    716716    /**
     717     * Perform reinitialization tasks.
     718     *
     719     * Prevents a callback from being injected during unserialization of an object.
     720     *
     721     * @return void
     722     */
     723    public function __wakeup() {
     724        if ( $this->parent && ! $this->parent instanceof self ) {
     725            throw new UnexpectedValueException();
     726        }
     727        if ( $this->headers && ! is_array( $this->headers ) ) {
     728            throw new UnexpectedValueException();
     729        }
     730        foreach ( $this->headers as $value ) {
     731            if ( ! is_string( $value ) ) {
     732                throw new UnexpectedValueException();
     733            }
     734        }
     735        $this->headers_sanitized = array();
     736    }
     737
     738    /**
    717739     * Adds theme data to cache.
    718740     *
     
    17721794        return strnatcasecmp( $a->name_translated, $b->name_translated );
    17731795    }
     1796
     1797    private static function _check_headers_property_has_correct_type( $headers ) {
     1798        if ( ! is_array( $headers ) ) {
     1799            return false;
     1800        }
     1801        foreach ( $headers as $key => $value ) {
     1802            if ( ! is_string( $key ) || ! is_string( $value ) ) {
     1803                return false;
     1804            }
     1805        }
     1806        return true;
     1807    }
    17741808}
Note: See TracChangeset for help on using the changeset viewer.