Making WordPress.org

Changeset 13636


Ignore:
Timestamp:
05/01/2024 01:23:04 AM (10 months ago)
Author:
dd32
Message:

Plugin Directory: Review: Suffix ZIP urls with the API through .zip#wporgapi:https://.... rather than through .zip?info=https...

This will improve the experience for reviewers, as otherwise ? needs to be escaped on the command line.

See #7385.

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/admin/list-table/class-plugin-posts.php

    r13611 r13636  
    713713            $name = $zip_file->submitted_name;
    714714            if ( ! $name ) {
    715                 $name = explode( '?', basename( $url ) )[0];
     715                $name = preg_split( '/[?#]/', basename( $url ) )[0];
    716716                $name = explode( '_', $name, 3 )[2];
    717717            }
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php

    r13610 r13636  
    18531853        }
    18541854
    1855         $url = add_query_arg(
    1856             'info',
    1857             urlencode( rest_url( sprintf(
    1858                 'plugins/v1/pending-plugin/%d-%s/',
    1859                 $post->ID,
    1860                 $token
    1861             ) ) ),
    1862             $url
    1863         );
     1855        // Append with a anchor, such that CLI environments don't require special handling.
     1856        $url .= '#wporgapi:' . rest_url( sprintf(
     1857            'plugins/v1/pending-plugin/%d-%s/',
     1858            $post->ID,
     1859            $token
     1860        ) );
    18641861
    18651862        return $url;
Note: See TracChangeset for help on using the changeset viewer.