Make WordPress Core


Ignore:
Timestamp:
10/12/2023 03:14:45 PM (3 years ago)
Author:
joemcgill
Message:

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

Location:
branches/5.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.8

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

    r51003 r56884  
    677677
    678678        /**
     679         * Perform reinitialization tasks.
     680         *
     681         * Prevents a callback from being injected during unserialization of an object.
     682         *
     683         * @return void
     684         */
     685        public function __wakeup() {
     686                if ( $this->parent && ! $this->parent instanceof self ) {
     687                        throw new UnexpectedValueException();
     688                }
     689                if ( $this->headers && ! is_array( $this->headers ) ) {
     690                        throw new UnexpectedValueException();
     691                }
     692                foreach ( $this->headers as $value ) {
     693                        if ( ! is_string( $value ) ) {
     694                                throw new UnexpectedValueException();
     695                        }
     696                }
     697                $this->headers_sanitized = array();
     698        }
     699
     700        /**
    679701         * Adds theme data to cache.
    680702         *
     
    16761698                return strnatcasecmp( $a->name_translated, $b->name_translated );
    16771699        }
     1700
     1701        private static function _check_headers_property_has_correct_type( $headers ) {
     1702                if ( ! is_array( $headers ) ) {
     1703                        return false;
     1704                }
     1705                foreach ( $headers as $key => $value ) {
     1706                        if ( ! is_string( $key ) || ! is_string( $value ) ) {
     1707                                return false;
     1708                        }
     1709                }
     1710                return true;
     1711        }
    16781712}
Note: See TracChangeset for help on using the changeset viewer.