Opened 6 years ago
Last modified 5 months ago
#50279 new defect (bug)
add_query_arg() removes equal sign from assigned value
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | 5.4.1 |
| Component: | General | Keywords: | has-patch |
| Focuses: | Cc: |
Description
If you add a query array like this:
<?php $data =[ 'api_id' => 'xxxxx==', 'to' => 123456, 'text' => "Prueba", ]; $url = add_query_arg( $data , 'https://xxx.com' );
The $url you get is this: https://xxx.com?api_id=xxxxx=&to=123456&text=Prueba
The line 1142:
<?php $ret = preg_replace( '#=(&|$)#', '$1', $ret );
Gets "xxxxx==" and return "xxxxx=".
Please fix it.
Kind regards.
Change History (2)
#1
@
5 years ago
- Keywords needs-patch added
- Summary changed from Issue in add_query_arg function. wp-includes/functions.php - line 1142 to add_query_arg() removes equal sign from assigned value
This ticket was mentioned in PR #9822 on WordPress/wordpress-develop by @abcd95.
5 months ago
#2
- Keywords has-patch added; needs-patch removed
Note: See
TracTickets for help on using
tickets.
The example URL keeps the API ID value intact without the
preg_replace, but I don't know what might break (for others) without it.For history, that line was added in [5999] on ticket #4878.