[wp-trac] [WordPress Trac] #58017: Exception thrown when using array-data in URL query
WordPress Trac
noreply at wordpress.org
Thu Mar 30 05:14:51 UTC 2023
#58017: Exception thrown when using array-data in URL query
--------------------------+-----------------------------
Reporter: saemideluxe | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Menus | Version: 6.2
Severity: normal | Keywords: needs-refresh
Focuses: |
--------------------------+-----------------------------
When using the following URL query:
?mtype=libraryitem&maps-tag%5B0%5D=children
Then the following function:
/wp-includes/blocks/navigation-link.php(129):
block_core_navigation_link_maybe_urldecode
will throw the following Error:
Uncaught TypeError: rawurldecode(): Argument #1 ($string) must be of
type string, array given
because the function wp_parse_args (that is used in the function above)
will parse the given URL to return query-keys ending with []-characters to
be an array and not a plain string, see output from print_r:
(
[mtype] => libraryitem
[maps-tag] => Array
(
[0] => children
)
)
But the function rawurldecode that is used below expects the argument to
be a string, not an array.
This suddenly started happening, I assume after 6.2 got released on March
29, 2023.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58017>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list