Make WordPress Core


Ignore:
Timestamp:
04/08/2019 01:09:01 AM (6 years ago)
Author:
pento
Message:

Canonical: Ensure redirect query keys are URL encoded.

This prevents an infinite redirect loop when a request containing URL-encoded characters triggers is_404().

Props soulseekah, wrwrwr0.
Fixes #43745.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/canonical.php

    r43571 r45133  
    389389        }
    390390
    391         $_parsed_query = rawurlencode_deep( $_parsed_query );
     391        $_parsed_query = array_combine(
     392            rawurlencode_deep( array_keys( $_parsed_query ) ),
     393            rawurlencode_deep( array_values( $_parsed_query ) )
     394        );
    392395        $redirect_url  = add_query_arg( $_parsed_query, $redirect_url );
    393396    }
Note: See TracChangeset for help on using the changeset viewer.