From 119bdcadae3fccb26ead25796bf8a352e314efd7 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 3 Apr 2010 18:14:42 +0000 Subject: Fixes #1184 - added elgg_format_url() for handling ampersands in urls git-svn-id: http://code.elgg.org/elgg/trunk@5603 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'engine/lib') diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 04e04fbbc..f106e4ded 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -2598,6 +2598,17 @@ interface Friendable { public function countObjects($subtype = ""); } +/** + * Handles formatting of ampersands in urls + * + * @param string $url + * @return string + * @since 1.8 + */ +function elgg_format_url($url) { + return preg_replace('/&(?!amp;)/', '&', $url); +} + /** * Rebuilds a parsed (partial) URL * @@ -2615,7 +2626,7 @@ function elgg_http_build_url(array $parts) { $string = $scheme . $host . $port . $path . $query; - return $string; + return elgg_format_url($string); } -- cgit v1.2.3