WordPress.org

Make WordPress Core

Opened 29 hours ago

#50279 new defect (bug)

Issue in add_query_arg function. wp-includes/functions.php - line 1142

Reported by: artprojectgroup Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.4.1
Component: General Keywords:
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 (0)

Note: See TracTickets for help on using tickets.