From 61337b126e0ee3a316f5cb9faf8982b0803793a4 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Tue, 13 Sep 2011 21:22:28 -0400 Subject: Fixes #3811 defaulting title to confirm text if passed to output/confirmlink --- views/default/output/confirmlink.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'views/default/output/confirmlink.php') diff --git a/views/default/output/confirmlink.php b/views/default/output/confirmlink.php index 5059a656e..31a34ae63 100644 --- a/views/default/output/confirmlink.php +++ b/views/default/output/confirmlink.php @@ -25,8 +25,8 @@ if ($encode) { $text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8', false); } -if (!isset($vars['title'])) { - $vars['title'] = addslashes($confirm); +if (!isset($vars['title']) && isset($vars['confirm'])) { + $vars['title'] = $vars['rel']; } if (isset($vars['class'])) { -- cgit v1.2.3 From d50ec282fa3da9947968e959affd48825b2a7bbb Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 30 Sep 2011 17:03:51 -0400 Subject: Fixes #3904 action word should come first for encode_text parameter --- engine/lib/navigation.php | 2 +- mod/groups/start.php | 4 ++-- mod/likes/views/default/annotation/likes.php | 2 +- mod/messageboard/start.php | 2 +- mod/messages/views/default/object/messages.php | 2 +- views/default/core/friends/collection.php | 2 +- views/default/output/confirmlink.php | 12 ++++++------ 7 files changed, 13 insertions(+), 13 deletions(-) (limited to 'views/default/output/confirmlink.php') diff --git a/engine/lib/navigation.php b/engine/lib/navigation.php index 27af26be2..778da94e9 100644 --- a/engine/lib/navigation.php +++ b/engine/lib/navigation.php @@ -393,7 +393,7 @@ function elgg_annotation_menu_setup($hook, $type, $return, $params) { 'href' => $url, 'text' => "", 'confirm' => elgg_echo('deleteconfirm'), - 'text_encode' => false + 'encode_text' => false ); $return[] = ElggMenuItem::factory($options); } diff --git a/mod/groups/start.php b/mod/groups/start.php index 9e4694457..0425bdea6 100644 --- a/mod/groups/start.php +++ b/mod/groups/start.php @@ -435,7 +435,7 @@ function groups_annotation_menu_setup($hook, $type, $return, $params) { 'href' => $url, 'text' => "", 'confirm' => elgg_echo('deleteconfirm'), - 'text_encode' => false + 'encode_text' => false ); $return[] = ElggMenuItem::factory($options); @@ -447,7 +447,7 @@ function groups_annotation_menu_setup($hook, $type, $return, $params) { 'name' => 'edit', 'href' => "#edit-annotation-$annotation->id", 'text' => elgg_echo('edit'), - 'text_encode' => false, + 'encode_text' => false, 'rel' => 'toggle', ); $return[] = ElggMenuItem::factory($options); diff --git a/mod/likes/views/default/annotation/likes.php b/mod/likes/views/default/annotation/likes.php index e1ae20818..2dd01b6cd 100644 --- a/mod/likes/views/default/annotation/likes.php +++ b/mod/likes/views/default/annotation/likes.php @@ -31,7 +31,7 @@ if ($like->canEdit()) { 'href' => "action/likes/delete?annotation_id={$like->id}", 'text' => "", 'confirm' => elgg_echo('deleteconfirm'), - 'text_encode' => false, + 'encode_text' => false, )); } diff --git a/mod/messageboard/start.php b/mod/messageboard/start.php index 8a7f00958..0b0155069 100644 --- a/mod/messageboard/start.php +++ b/mod/messageboard/start.php @@ -150,7 +150,7 @@ function messageboard_annotation_menu_setup($hook, $type, $return, $params) { 'href' => $url, 'text' => "", 'confirm' => elgg_echo('deleteconfirm'), - 'text_encode' => false + 'encode_text' => false ); $return[] = ElggMenuItem::factory($options); } diff --git a/mod/messages/views/default/object/messages.php b/mod/messages/views/default/object/messages.php index b2d127d85..b6f9ed6d5 100644 --- a/mod/messages/views/default/object/messages.php +++ b/mod/messages/views/default/object/messages.php @@ -69,7 +69,7 @@ $delete_link = elgg_view("output/confirmlink", array( 'href' => "action/messages/delete?guid=" . $message->getGUID(), 'text' => "", 'confirm' => elgg_echo('deleteconfirm'), - 'text_encode' => false, + 'encode_text' => false, )); $body = <<owner_guid == elgg_get_logged_in_user_guid()) { 'href' => 'action/friends/collections/delete?collection=' . $coll->id, 'class' => 'delete_collection', 'text' => elgg_view_icon('delete'), - 'text_encode' => false, + 'encode_text' => false, )); echo ""; } diff --git a/views/default/output/confirmlink.php b/views/default/output/confirmlink.php index 31a34ae63..953c15f1b 100644 --- a/views/default/output/confirmlink.php +++ b/views/default/output/confirmlink.php @@ -6,16 +6,16 @@ * @package Elgg * @subpackage Core * - * @uses $vars['text'] The text of the link - * @uses $vars['href'] The address - * @uses $vars['title'] The title text (defaults to confirm text) - * @uses $vars['confirm'] The dialog text - * @uses $vars['text_encode'] Encode special characters? (false) + * @uses $vars['text'] The text of the link + * @uses $vars['href'] The address + * @uses $vars['title'] The title text (defaults to confirm text) + * @uses $vars['confirm'] The dialog text + * @uses $vars['encode_text'] Run $vars['text'] through htmlspecialchars() (false) */ $vars['rel'] = elgg_extract('confirm', $vars, elgg_echo('question:areyousure')); $vars['rel'] = addslashes($vars['rel']); -$encode = elgg_extract('text_encode', $vars, false); +$encode = elgg_extract('encode_text', $vars, false); // always generate missing action tokens $vars['href'] = elgg_add_action_tokens_to_url(elgg_normalize_url($vars['href']), true); -- cgit v1.2.3 From 7904f4c40fb4f2520524c151a1e71569a3993f58 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 13 Nov 2011 16:20:03 -0500 Subject: need to unset the trusted link key --- views/default/output/confirmlink.php | 1 + 1 file changed, 1 insertion(+) (limited to 'views/default/output/confirmlink.php') diff --git a/views/default/output/confirmlink.php b/views/default/output/confirmlink.php index 953c15f1b..532790a38 100644 --- a/views/default/output/confirmlink.php +++ b/views/default/output/confirmlink.php @@ -41,6 +41,7 @@ if (isset($vars['class'])) { unset($vars['encode_text']); unset($vars['text']); unset($vars['confirm']); +unset($vars['is_trusted']); $attributes = elgg_format_attributes($vars); echo "$text"; -- cgit v1.2.3