- Timestamp:
- 12/21/2021 04:12:06 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php
r52372 r52399 17 17 class WP_REST_Themes_Controller extends WP_REST_Controller { 18 18 19 const PATTERN = '[^.\/]+(?:\/[^.\/]+)?'; 19 /** 20 * Matches theme's directory: `/themes/<subdirectory>/<theme>/` or `/themes/<theme>/`. 21 * Excludes invalid directory name characters: `/:<>*?"|`. 22 */ 23 const PATTERN = '[^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?'; 20 24 21 25 /** … … 57 61 'args' => array( 58 62 'stylesheet' => array( 59 'description' => __( "The theme's stylesheet. This uniquely identifies the theme." ), 60 'type' => 'string', 63 'description' => __( "The theme's stylesheet. This uniquely identifies the theme." ), 64 'type' => 'string', 65 'sanitize_callback' => array( $this, '_sanitize_stylesheet_callback' ), 61 66 ), 62 67 ), … … 69 74 ) 70 75 ); 76 } 77 78 /** 79 * Sanitize the stylesheet to decode endpoint. 80 * 81 * @since 5.9.0 82 * 83 * @param string $stylesheet The stylesheet name. 84 * @return string Sanitized stylesheet. 85 */ 86 public function _sanitize_stylesheet_callback( $stylesheet ) { 87 return urldecode( $stylesheet ); 71 88 } 72 89
Note: See TracChangeset
for help on using the changeset viewer.