elgg_http_add_url_query_elements() could be used here.