aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/elgglib.php13
1 files changed, 12 insertions, 1 deletions
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
@@ -2599,6 +2599,17 @@ interface Friendable {
}
/**
+ * 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
*
* @param array $parts Associative array of URL components like parse_url() returns
@@ -2615,7 +2626,7 @@ function elgg_http_build_url(array $parts) {
$string = $scheme . $host . $port . $path . $query;
- return $string;
+ return elgg_format_url($string);
}