Changeset 5247
- Timestamp:
- 04/05/2017 04:30:11 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-import.php
r5201 r5247 231 231 $tagged_versions = SVN::ls( "https://plugins.svn.wordpress.org/{$plugin_slug}/tags/" ) ?: array(); 232 232 $tagged_versions = array_map( function( $item ) { 233 return rtrim( $item, '/' ); 233 $trimmed_item = rtrim( $item, '/' ); 234 if ( $trimmed_item == $item ) { 235 // If attempting to trim `/` off didn't do anything, it was a file and we want to discard it. 236 return null; 237 } 238 239 // Prefix the 0 for plugin versions like 0.1 240 if ( '.' == substr( $trimmed_item, 0, 1 ) ) { 241 $trimmed_item = "0{$trimmed_item}"; 242 } 243 244 return $trimmed_item; 234 245 }, $tagged_versions ); 246 247 // Strip out any of the before-found files which we set to NULL 248 $tagged_versions = array_filter( $tagged_versions, function( $item ) { 249 return ! is_null( $item ); 250 } ); 235 251 236 252 // Not all plugins utilise `trunk`, some just tag versions.
Note: See TracChangeset
for help on using the changeset viewer.