Making WordPress.org


Ignore:
Timestamp:
08/21/2020 05:55:20 AM (6 years ago)
Author:
dd32
Message:

Plugin Directory: Consistently redirect to the referer instead of just back to the plugin page.

File:
1 edited

Legend:

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

    r10126 r10196  
    6666         */
    6767        public function self_transfer( $request ) {
    68                 $plugin   = Plugin_Directory::get_plugin_post( $request['plugin_slug'] );
    69                 $location = get_permalink( $plugin ) . 'advanced/';
    70                 header( "Location: $location" );
     68                $plugin = Plugin_Directory::get_plugin_post( $request['plugin_slug'] );
    7169                $result = [
    72                         'location'    => $location,
     70                        'location'    => wp_get_referer() ?: get_permalink( $plugin ),
    7371                        'transferred' => false,
    7472                ];
     73                header( 'Location: ' . $result['location'] );
    7574
    7675                // New owner must also have commit rights.
Note: See TracChangeset for help on using the changeset viewer.