Make WordPress Core


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

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

Location:
branches/5.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.9

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

    r52365 r56875  
    706706
    707707    /**
     708     * Perform reinitialization tasks.
     709     *
     710     * Prevents a callback from being injected during unserialization of an object.
     711     *
     712     * @return void
     713     */
     714    public function __wakeup() {
     715        if ( $this->parent && ! $this->parent instanceof self ) {
     716            throw new UnexpectedValueException();
     717        }
     718        if ( $this->headers && ! is_array( $this->headers ) ) {
     719            throw new UnexpectedValueException();
     720        }
     721        foreach ( $this->headers as $value ) {
     722            if ( ! is_string( $value ) ) {
     723                throw new UnexpectedValueException();
     724            }
     725        }
     726        $this->headers_sanitized = array();
     727    }
     728
     729    /**
    708730     * Adds theme data to cache.
    709731     *
     
    17641786        return strnatcasecmp( $a->name_translated, $b->name_translated );
    17651787    }
     1788
     1789    private static function _check_headers_property_has_correct_type( $headers ) {
     1790        if ( ! is_array( $headers ) ) {
     1791            return false;
     1792        }
     1793        foreach ( $headers as $key => $value ) {
     1794            if ( ! is_string( $key ) || ! is_string( $value ) ) {
     1795                return false;
     1796            }
     1797        }
     1798        return true;
     1799    }
    17661800}
Note: See TracChangeset for help on using the changeset viewer.