Make WordPress Core


Ignore:
Timestamp:
10/12/2023 03:02:41 PM (3 years ago)
Author:
davidbaumwald
Message:

Grouped backports to the 5.1 branch.

  • Comments: Prevent users who can not see a post from seeing comments on it.
  • Shortcodes: Restrict media shortcode ajax to certain type.
  • REST API: Ensure no-cache headers are sent when methods are overridden.
  • REST API: Limit search_columns for users without list_users.
  • Prevent unintended behavior when certain objects are unserialized.

Merges [56833], [56834], [56835], [56836], and [56838] to the 5.1 branch.
Props xknown, jorbin, joehoyle, timothyblynjacobs, peterwilsoncc, ehtis, tykoted, antpb, rmccue.

Location:
branches/5.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.1

  • branches/5.1/src/wp-includes/Requests/IRI.php

    r38727 r56873  
    704704        }
    705705
     706        public function __wakeup() {
     707                $class_props = get_class_vars( __CLASS__ );
     708                $string_props = array( 'scheme', 'iuserinfo', 'ihost', 'port', 'ipath', 'iquery', 'ifragment' );
     709                $array_props = array( 'normalization' );
     710                foreach ( $class_props as $prop => $default_value ) {
     711                        if ( in_array( $prop, $string_props, true ) && ! is_string( $this->$prop ) ) {
     712                                throw new UnexpectedValueException();
     713                        } elseif ( in_array( $prop, $array_props, true ) && ! is_array( $this->$prop ) ) {
     714                                throw new UnexpectedValueException();
     715                        }
     716                        $this->$prop = null;
     717                }
     718        }
     719
    706720        /**
    707721         * Set the entire IRI. Returns true on success, false on failure (if there
Note: See TracChangeset for help on using the changeset viewer.