Making WordPress.org

Changeset 13726


Ignore:
Timestamp:
05/17/2024 04:15:37 AM (6 months ago)
Author:
dd32
Message:

Plugin Directory: Import: When importing from SVN, if the plugin specifies a Stable Tag that does not exist, and we fall back to trunk, warn them.

See #6380, #6108.
Fixes #5645.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
Files:
2 edited

Legend:

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

    r13725 r13726  
    629629        }
    630630
     631        // Fall back to using `trunk` as stable, if the tag doesn't exist.
    631632        if ( ! $svn_info || ! $svn_info['result'] ) {
    632             $stable_tag = 'trunk';
    633             $stable_url = self::PLUGIN_SVN_BASE . "/{$plugin_slug}/trunk";
    634             $svn_info   = SVN::info( $stable_url );
    635         }
     633            if ( 'trunk' !== $stable_tag ) {
     634                $this->warnings['stable_tag_invalid_trunk_fallback'] = $stable_tag;
     635                $this->warnings['stable_tag_invalid']                = true;
     636            }
     637
     638            $stable_tag = 'trunk';
     639            $stable_url = self::PLUGIN_SVN_BASE . "/{$plugin_slug}/trunk";
     640            $svn_info   = SVN::info( $stable_url );
     641        }
    636642
    637643        if ( ! $svn_info['result'] ) {
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-validator.php

    r13618 r13726  
    297297                    __( 'The %1$s field is missing or invalid.  Note: We ask you no longer attempt to use %2$s as stable, so that all plugins can be rolled back.', 'wporg-plugins' ),
    298298                    '<code>Stable tag</code>',
     299                    '<code>/trunk/</code>'
     300                );
     301            case 'stable_tag_invalid_trunk_fallback':
     302                return sprintf(
     303                    /* translators: 1: 'Stable tag', 2: path '/tags/{version}', 3: '/trunk/' */
     304                    __( 'The %1$s field is invalid, the specified SVN tag %2$s does not exist. %3$s will be used instead.', 'wporg-plugins' ),
     305                    '<code>Stable Tag</code>',
     306                    '<code>/tags/' . esc_html( $data ) . '/</code>',
    299307                    '<code>/trunk/</code>'
    300308                );
Note: See TracChangeset for help on using the changeset viewer.