aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-03 18:14:42 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-03 18:14:42 +0000
commit119bdcadae3fccb26ead25796bf8a352e314efd7 (patch)
tree06f33861d87c25e4fafdbb99df4b0d56248f3836 /engine/lib
parentdec5ccf4df668d8c55272fded36bdbd95ea5c7a2 (diff)
downloadelgg-119bdcadae3fccb26ead25796bf8a352e314efd7.tar.gz
elgg-119bdcadae3fccb26ead25796bf8a352e314efd7.tar.bz2
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
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;)/', '&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);
}