[wp-trac] [WordPress Trac] #52503: remove_query_arg() can create a url such as `/?#anchor` instead of `/#anchor`

WordPress Trac noreply at wordpress.org
Fri Feb 12 00:14:38 UTC 2021


#52503: remove_query_arg() can create a url such as `/?#anchor` instead of
`/#anchor`
--------------------------+----------------------------------------
 Reporter:  dd32          |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  lowest        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  trivial       |   Keywords:  needs-patch good-first-bug
  Focuses:                |
--------------------------+----------------------------------------
 When running remove_query_arg(), the output of the query vars differs
 based on if an anchor tag is included.

 For example:
 {{{
 wp> remove_query_arg( 'foo', 'https://example.org/?foo=bar#baz' );
 string(25) "https://example.org/?#baz"

 wp> remove_query_arg( 'foo', 'https://example.org/?foo=bar' );
 string(20) "https://example.org/"
 }}}

 In the first example, the `?` should not be included.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52503>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list