Make WordPress Core


Ignore:
Timestamp:
10/12/2023 02:54:10 PM (8 months ago)
Author:
joemcgill
Message:

Grouped backports to the 6.1 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.1 branch.
Props xknown, jorbin, Vortfu, joehoyle, timothyblynjacobs, peterwilsoncc, ehtis, tykoted, martinkrcho, paulkevan, dd32, antpb, rmccue.

Location:
branches/6.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.1

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

    r54236 r56867  
    719719
    720720    /**
     721     * Perform reinitialization tasks.
     722     *
     723     * Prevents a callback from being injected during unserialization of an object.
     724     *
     725     * @return void
     726     */
     727    public function __wakeup() {
     728        if ( $this->parent && ! $this->parent instanceof self ) {
     729            throw new UnexpectedValueException();
     730        }
     731        if ( $this->headers && ! is_array( $this->headers ) ) {
     732            throw new UnexpectedValueException();
     733        }
     734        foreach ( $this->headers as $value ) {
     735            if ( ! is_string( $value ) ) {
     736                throw new UnexpectedValueException();
     737            }
     738        }
     739        $this->headers_sanitized = array();
     740    }
     741
     742    /**
    721743     * Adds theme data to cache.
    722744     *
     
    17791801        return strnatcasecmp( $a->name_translated, $b->name_translated );
    17801802    }
     1803
     1804    private static function _check_headers_property_has_correct_type( $headers ) {
     1805        if ( ! is_array( $headers ) ) {
     1806            return false;
     1807        }
     1808        foreach ( $headers as $key => $value ) {
     1809            if ( ! is_string( $key ) || ! is_string( $value ) ) {
     1810                return false;
     1811            }
     1812        }
     1813        return true;
     1814    }
    17811815}
Note: See TracChangeset for help on using the changeset viewer.