Changeset 56851 for branches/4.2/src/wp-includes/class-wp-theme.php
- Timestamp:
- 10/12/2023 02:25:18 PM (2 years ago)
- File:
-
- 1 edited
-
branches/4.2/src/wp-includes/class-wp-theme.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.2/src/wp-includes/class-wp-theme.php
r39814 r56851 478 478 479 479 /** 480 * Perform reinitialization tasks. 481 * 482 * Prevents a callback from being injected during unserialization of an object. 483 * 484 * @return void 485 */ 486 public function __wakeup() { 487 if ( $this->parent && ! $this->parent instanceof self ) { 488 throw new UnexpectedValueException(); 489 } 490 if ( $this->headers && ! is_array( $this->headers ) ) { 491 throw new UnexpectedValueException(); 492 } 493 foreach ( $this->headers as $value ) { 494 if ( ! is_string( $value ) ) { 495 throw new UnexpectedValueException(); 496 } 497 } 498 $this->headers_sanitized = array(); 499 } 500 501 /** 480 502 * Adds theme data to cache. 481 503 * … … 1236 1258 return strnatcasecmp( $a->display( 'Name', false, true ), $b->display( 'Name', false, true ) ); 1237 1259 } 1260 1261 private static function _check_headers_property_has_correct_type( $headers ) { 1262 if ( ! is_array( $headers ) ) { 1263 return false; 1264 } 1265 foreach ( $headers as $key => $value ) { 1266 if ( ! is_string( $key ) || ! is_string( $value ) ) { 1267 return false; 1268 } 1269 } 1270 return true; 1271 } 1238 1272 }
Note: See TracChangeset
for help on using the changeset viewer.