Making WordPress.org

Changeset 9488


Ignore:
Timestamp:
02/11/2020 05:09:47 AM (4 years ago)
Author:
dd32
Message:

Plugin Directory: Search: When a search request >=1600 characters is made, redirect back to the homepage like we do with empty searches.

Fixes #4322.

File:
1 edited

Legend:

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

    r9481 r9488  
    12911291
    12921292        // Empty search query.
    1293         if ( 'search' === get_query_var( 'name' ) || isset( $_GET['s'] ) && ! get_query_var( 's' ) ) {
     1293        // This may occur due to WordPress's 1600 character search limit.
     1294        if (
     1295                'search' === get_query_var( 'name' ) ||
     1296                ( isset( $_GET['s'] ) && ! get_query_var( 's' ) ) ||
     1297                ( is_search() && 0 === strlen( get_query_var( 's' ) ) )
     1298        ) {
    12941299            wp_safe_redirect( site_url( '/' ), 301 );
    12951300            die();
Note: See TracChangeset for help on using the changeset viewer.