WordPress.org

Make WordPress Core

Opened 3 weeks ago

#44499 new defect (bug)

add_query_arg function doesn't remove the empty '?' when an anchor exists

Reported by: benjamin.anakena Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version: 4.9.6
Component: General Keywords:
Focuses: Cc:

Description

To reproduce:

<?php
$url = 'https://domain.com/uri?param=value#anchor';
$url = add_query_arg( 'param', false, $url );
echo $url;

Expected value: https://domain.com/uri#anchor
Returned value: https://domain.com/uri?#anchor

Change History (0)

Note: See TracTickets for help on using tickets.