[wp-trac] [WordPress Trac] #44499: add_query_arg function doesn't remove the empty '?' when an anchor exists

WordPress Trac noreply at wordpress.org
Tue Nov 16 17:45:30 UTC 2021


#44499: add_query_arg function doesn't remove the empty '?' when an anchor exists
--------------------------------------+-----------------------------
 Reporter:  benjamin.anakena          |       Owner:  hellofromTonya
     Type:  defect (bug)              |      Status:  assigned
 Priority:  normal                    |   Milestone:  5.9
Component:  General                   |     Version:  4.9.6
 Severity:  minor                     |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-----------------------------
Changes (by hellofromTonya):

 * keywords:  has-patch needs-testing has-unit-tests => has-patch has-unit-
     tests


Comment:

 = Test Report

 Env:
 * Browser: Chrome, Firefox, Edge, and Safari
 * OS: macOS
 * localhost: wp-env
 * WordPress: trunk
 * Theme: TT2
 * Plugins: none

 == Steps

 1. Go to "Posts" and then "Add New"
 2. In the content, add some filler paragraphs.
 3. And then add a `header` block towards the bottom of the content.
 4. With the `header` block selected, click on "Advanced" and set the "HTML
 anchor" to `anchor`.
 5. Set the permalinks to something other than "Plain".
 6. View the new post in the front-end
 7. Click in the browser's search bar and append `?param=value#anchor` to
 the end of the URL. Press enter or return.

 The post should reload and jump to the header block.

 8. Apply the patch.
 9. Repeat step 6 and 7.

 Should again jump to the header block.

 == Results

 There is no bug or issue in the front-end as the browser handles the query
 args and jumps to the anchor ✅

 With and without the patch, each browser behaved the same ✅

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44499#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list