WordPress.org

Making WordPress.org

Changeset 5217


Ignore:
Timestamp:
03/30/2017 09:42:37 PM (3 years ago)
Author:
Otto42
Message:

Plugin Directory: Instead of redirecting for clients that give a URL fragment, simply serve the plugin without a redirect. This is because sending a redirect to the plugin will end up in a redirect loop which is cached. Sending the actual content, which we have and know will prevent this loop.

File:
1 edited

Legend:

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

    r5216 r5217  
    445445        add_rewrite_rule( '^([^/]+)/(installation|faq|screenshots|changelog|stats|developers|other_notes)/?$', 'index.php?redirect_plugin=$matches[1]&redirect_plugin_tab=$matches[2]', 'top' );
    446446
    447         // Handle redirects for broken clients that send #'s to the server
    448         add_rewrite_rule( '^([^/]+)/\#(.*)/?$', 'index.php?redirect_plugin=$matches[1]', 'top' );
     447        // Handle content for broken clients that send #'s to the server
     448        add_rewrite_rule( '^([^/]+)/\#(.*)/?$', 'index.php?name=$matches[1]', 'top' );
    449449
    450450        // If changing capabilities around, uncomment this.
     
    10221022        }
    10231023   
    1024         // Handle a redirect for /$plugin/#$tab_name to just /$plugin/, because some clients don't like fragments in redirects
    1025         if ( get_query_var( 'redirect_plugin' ) ) {
    1026             wp_safe_redirect( site_url( get_query_var( 'redirect_plugin' ) . '/' ) );
    1027             die();
    1028         }
    1029 
    10301024        // We've disabled WordPress's default 404 redirects, so we'll handle them ourselves.
    10311025        if ( is_404() ) {
Note: See TracChangeset for help on using the changeset viewer.