Changeset 13016
- Timestamp:
- 12/06/2023 12:17:52 AM (16 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-import.php
r12979 r13016 86 86 $current_stable_tag = get_post_meta( $plugin->ID, 'stable_tag', true ) ?: 'trunk'; 87 87 $touches_stable_tag = (bool) array_intersect( [ $stable_tag, $current_stable_tag ], $svn_changed_tags ); 88 89 // Validate various headers: 90 91 /* 92 * Check to see if the plugin is using the `Update URI` header. 93 * 94 * Plugins on WordPress.org should NOT use this header, but we do accept some URI formats for it in the API, 95 * so those are allowed to pass here. 96 * Any documentation suggesting that a WordPress.org hosted plugin should use this header is incorrect. 97 */ 98 if ( $headers->UpdateURI ) { 99 $update_uri_valid = preg_match( '!^(https?://)?(wordpress.org|w.org)/plugins?/(?P<slug>[^/]+)/?$!i', $headers->UpdateURI, $update_uri_matches ); 100 if ( ! $update_uri_valid || $update_uri_matches['slug'] !== $plugin_slug ) { 101 throw new Exception( 'Invalid Update URI header detected: ' . $headers->UpdateURI ); 102 } 103 } 88 104 89 105 // Release confirmation
Note: See TracChangeset
for help on using the changeset viewer.