fixes #796 handle ampersand escaping for API URLs

When generating URLs for the web service (IN_WS), ensure the argument separator is a raw '&' instead of the HTML entity '&'. add_url_params now switches the separator to '&' if IN_WS is defined and '&' was requested. Removed a redundant str_replace call in ws_std_get_urls since get_action_url/add_url_params now produce the correct separator. This prevents double-escaped ampersands.
This commit is contained in:
Linty
2026-03-23 12:26:20 +01:00
parent 001a21056c
commit b19beee0aa
2 changed files with 6 additions and 1 deletions

View File

@@ -104,6 +104,11 @@ function add_url_params($url, $params, $arg_separator='&' )
{
if ( !empty($params) )
{
if (defined('IN_WS') and '&' === $arg_separator)
{
$arg_separator = '&';
}
assert( is_array($params) );
$is_first = true;
foreach($params as $param=>$val)