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 --- CHANGES.txt | 1 + engine/lib/elgglib.php | 13 ++++++++++- views/default/admin/plugins.php | 3 ++- views/default/admin/plugins_opt/plugin.php | 35 ++++++++++++++++++++---------- 4 files changed, 38 insertions(+), 14 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 074aa6c62..ed844f018 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -6,6 +6,7 @@ Version 1.8.0 Generic API changes: * Added elgg_instanceof(). * Added remove_subtype() and update_subtype(). + * Added elgg_format_url() UI/UX API changes: * Added elgg_push_breadcrumb(), elgg_pop_breadcrumb(), and elgg_get_breadcrumbs(). 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); } diff --git a/views/default/admin/plugins.php b/views/default/admin/plugins.php index 465b019f6..4388e7a3c 100644 --- a/views/default/admin/plugins.php +++ b/views/default/admin/plugins.php @@ -15,7 +15,8 @@ $token = generate_action_token($ts); // Page Header elements $title = elgg_view_title(elgg_echo('admin:plugins')); -$buttons = "url}action/admin/plugins/enableall?__elgg_token=$token&__elgg_ts=$ts\">".elgg_echo('enableall')." url}action/admin/plugins/disableall?__elgg_token=$token&__elgg_ts=$ts\">".elgg_echo('disableall')." "; +$buttons = "url}action/admin/plugins/enableall?__elgg_token=$token&__elgg_ts=$ts\">".elgg_echo('enableall').""; +$buttons .= "url}action/admin/plugins/disableall?__elgg_token=$token&__elgg_ts=$ts\">".elgg_echo('disableall')." "; // construct page header ?> diff --git a/views/default/admin/plugins_opt/plugin.php b/views/default/admin/plugins_opt/plugin.php index 0150e76d8..6184580d8 100644 --- a/views/default/admin/plugins_opt/plugin.php +++ b/views/default/admin/plugins_opt/plugin.php @@ -30,26 +30,37 @@ $token = generate_action_token($ts);
10) { + $top_url = "{$vars['url']}action/admin/plugins/reorder?plugin={$plugin}&order=1&__elgg_token=$token&__elgg_ts=$ts"; + $order = $vars['order'] - 11; + $up_url = "{$vars['url']}action/admin/plugins/reorder?plugin={$plugin}&order=$order&__elgg_token=$token&__elgg_ts=$ts"; ?> - - + + - - + +
- - - - + + + +
@@ -90,10 +101,10 @@ $token = generate_action_token($ts); ?> -
-
-
-
+
+
+
+
-- cgit v1.2.3