WordPress.org

Making WordPress.org

Changeset 10215


Ignore:
Timestamp:
08/28/2020 05:42:34 AM (4 weeks ago)
Author:
dd32
Message:

Plugin Directory: Release Confirmation: Ensure that only one release can exist per tag in the releases array.

See #5352.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php

    r10214 r10215  
    16011601        ];
    16021602
    1603         // Fill
     1603        // Fill the $release with the newish data. This could/should use wp_parse_args()?
    16041604        foreach ( $data as $k => $v ) {
    16051605            $release[ $k ] = $v;
     
    16081608        $releases = self::get_releases( $plugin );
    16091609
     1610        // Find any other releases using this slug (as in the case of updates) and remove it.
     1611        // Only one release can exist in any given tag.
     1612        foreach ( $releases as $i => $r ) {
     1613            if ( $r['tag'] === $release['tag'] ) {
     1614                unset( $releases[ $i ] );
     1615            }
     1616        }
     1617
     1618        // Add this release in
    16101619        $releases[] = $release;
    16111620
Note: See TracChangeset for help on using the changeset viewer.