Make WordPress Core


Ignore:
Timestamp:
10/12/2023 04:07:43 PM (16 months ago)
Author:
joemcgill
Message:

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

Location:
branches/6.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.2

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

    r55426 r56895  
    741741
    742742    /**
     743     * Perform reinitialization tasks.
     744     *
     745     * Prevents a callback from being injected during unserialization of an object.
     746     *
     747     * @return void
     748     */
     749    public function __wakeup() {
     750        if ( $this->parent && ! $this->parent instanceof self ) {
     751            throw new UnexpectedValueException();
     752        }
     753        if ( $this->headers && ! is_array( $this->headers ) ) {
     754            throw new UnexpectedValueException();
     755        }
     756        foreach ( $this->headers as $value ) {
     757            if ( ! is_string( $value ) ) {
     758                throw new UnexpectedValueException();
     759            }
     760        }
     761        $this->headers_sanitized = array();
     762    }
     763
     764    /**
    743765     * Adds theme data to cache.
    744766     *
     
    18091831        return strnatcasecmp( $a->name_translated, $b->name_translated );
    18101832    }
     1833
     1834    private static function _check_headers_property_has_correct_type( $headers ) {
     1835        if ( ! is_array( $headers ) ) {
     1836            return false;
     1837        }
     1838        foreach ( $headers as $key => $value ) {
     1839            if ( ! is_string( $key ) || ! is_string( $value ) ) {
     1840                return false;
     1841            }
     1842        }
     1843        return true;
     1844    }
    18111845}
Note: See TracChangeset for help on using the changeset viewer.