From: Brion Vibber Date: Fri, 22 Oct 2010 02:10:43 +0000 (-0700) Subject: Workaround for http_build_query() oddities in low-level router parent code when PHP... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d6f4588b9ede2cb26b06084b3117ec9184f9e64e;p=quix0rs-gnu-social.git Workaround for http_build_query() oddities in low-level router parent code when PHP config is set with non-default separator. --- diff --git a/lib/router.php b/lib/router.php index 417206e6bf..ab8c40668d 100644 --- a/lib/router.php +++ b/lib/router.php @@ -863,7 +863,16 @@ class Router if ($qpos !== false) { $url = substr($url, 0, $qpos+1) . str_replace('?', '&', substr($url, $qpos+1)); + + // @fixme this is a hacky workaround for http_build_query in the + // lower-level code and bad configs that set the default separator + // to & instead of &. Encoded &s in parameters will not be + // affected. + $url = substr($url, 0, $qpos+1) . + str_replace('&', '&', substr($url, $qpos+1)); + } + return $url; } }