WordPress.org

Make WordPress Core

#23519 closed defect (bug) (duplicate)

esc_url() mangles array format query variables in URLs

Reported by: johnbillion Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.4
Component: Formatting Keywords:
Focuses: Cc:

Description

http://example.com/?test[foo]=bar is a valid URL, but esc_url() mangles it into http://example.com/?testfoo=bar.

To reproduce:

$url = 'http://example.com/?test[foo]=bar';

echo '<pre>';
var_dump( $url );
var_dump( esc_url( $url ) );
echo '</pre>';

Also affects array format query variables without named keys, eg. foo[]=bar.

Tested back to 3.4. May affect earlier versions.

Change History (1)

comment:1 SergeyBiryukov14 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #16859.

Note: See TracTickets for help on using tickets.