]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #3411 output/url now has a is_trusted parameter - defaults to false
authorCash Costello <cash.costello@gmail.com>
Sat, 8 Oct 2011 12:22:08 +0000 (08:22 -0400)
committerCash Costello <cash.costello@gmail.com>
Sat, 8 Oct 2011 12:22:08 +0000 (08:22 -0400)
64 files changed:
engine/classes/ElggMenuItem.php
mod/blog/views/default/blog/group_module.php
mod/blog/views/default/blog/sidebar/revisions.php
mod/blog/views/default/object/blog.php
mod/blog/views/default/widgets/blog/content.php
mod/bookmarks/views/default/bookmarks/group_module.php
mod/bookmarks/views/default/object/bookmarks.php
mod/bookmarks/views/default/widgets/bookmarks/content.php
mod/developers/views/default/theme_preview/general.php
mod/diagnostics/views/default/admin/develop_utilities/diagnostics.php
mod/file/views/default/file/group_module.php
mod/file/views/default/icon/object/file.php
mod/file/views/default/object/file.php
mod/file/views/default/widgets/filerepo/content.php
mod/groups/views/default/discussion/group_module.php
mod/groups/views/default/groups/invitationrequests.php
mod/groups/views/default/groups/membershiprequests.php
mod/groups/views/default/groups/profile/activity_module.php
mod/groups/views/default/groups/profile/summary.php
mod/groups/views/default/groups/sidebar/members.php
mod/groups/views/default/object/groupforumtopic.php
mod/groups/views/default/widgets/a_users_groups/content.php
mod/likes/views/default/annotation/likes.php
mod/likes/views/default/likes/button.php
mod/logbrowser/views/default/logbrowser/table.php
mod/messageboard/views/default/widgets/messageboard/content.php
mod/messages/views/default/object/messages.php
mod/pages/views/default/annotation/page.php
mod/pages/views/default/object/page_top.php
mod/pages/views/default/pages/group_module.php
mod/pages/views/default/widgets/pages/content.php
mod/reportedcontent/views/default/object/reported_content.php
mod/thewire/views/default/object/thewire.php
mod/thewire/views/default/river/object/thewire/create.php
mod/thewire/views/default/thewire/profile_status.php
mod/thewire/views/default/widgets/thewire/content.php
mod/twitter_api/views/default/forms/twitter_api/interstitial_settings.php
mod/uservalidationbyemail/views/default/forms/uservalidationbyemail/bulk_action.php
views/default/admin/appearance/default_widgets.php
views/default/admin/appearance/profile_fields/list.php
views/default/admin/header.php
views/default/icon/default.php
views/default/icon/user/default.php
views/default/navigation/breadcrumbs.php
views/default/navigation/menu/user_hover.php
views/default/navigation/pagination.php
views/default/navigation/tabs.php
views/default/object/admin_notice.php
views/default/object/default.php
views/default/object/elements/summary.php
views/default/object/plugin/advanced.php
views/default/object/plugin/simple.php
views/default/object/widget/elements/controls.php
views/default/output/tag.php
views/default/output/url.php
views/default/page/elements/footer.php
views/default/page/elements/tagcloud_block.php
views/default/page/layouts/widgets/add_button.php
views/default/river/elements/body.php
views/default/river/elements/responses.php
views/default/river/elements/summary.php
views/default/river/user/default/profileiconupdate.php
views/default/river/user/default/profileupdate.php
views/default/widgets/content_stats/content.php

index b9c81fd786bc9ebb8c4325fb3fcaf2e31936e15e..8ddb1ecd856979fade6e285e1bb232c0224b3b19 100644 (file)
@@ -549,6 +549,10 @@ class ElggMenuItem {
                        }
                }
 
+               if (!isset($vars['rel']) && !isset($vars['is_trusted'])) {
+                       $vars['is_trusted'] = true;
+               }
+
                if ($this->confirm) {
                        $vars['confirm'] = $this->confirm;
                        return elgg_view('output/confirmlink', $vars);
index d769fbd59b64357999154640b90f76d5d78d51ff..0288271786e4f3df7732b18740ef8046d97a91ad 100644 (file)
@@ -12,6 +12,7 @@ if ($group->blog_enable == "no") {
 $all_link = elgg_view('output/url', array(
        'href' => "blog/group/$group->guid/all",
        'text' => elgg_echo('link:view:all'),
+       'is_trusted' => true,
 ));
 
 elgg_push_context('widgets');
@@ -33,6 +34,7 @@ if (!$content) {
 $new_link = elgg_view('output/url', array(
        'href' => "blog/add/$group->guid",
        'text' => elgg_echo('blog:write'),
+       'is_trusted' => true,
 ));
 
 echo elgg_view('groups/profile/module', array(
index c23b3b052605de51a9837b8adb0d06d222ff10a2..cd2e7f3d8bab790b1a597aac70bb8164a39da184 100644 (file)
@@ -39,7 +39,8 @@ if (elgg_instanceof($blog, 'object', 'blog') && $blog->canEdit()) {
                if ($blog->status == 'published') {
                        $load = elgg_view('output/url', array(
                                'href' => $load_base_url,
-                               'text' => elgg_echo('blog:status:published')
+                               'text' => elgg_echo('blog:status:published'),
+                               'is_trusted' => true,
                        ));
 
                        $time = "<span class='elgg-subtext'>"
@@ -59,7 +60,8 @@ if (elgg_instanceof($blog, 'object', 'blog') && $blog->canEdit()) {
                        }
                        $load = elgg_view('output/url', array(
                                'href' => "$load_base_url/$revision->id",
-                               'text' => $revision_lang
+                               'text' => $revision_lang,
+                               'is_trusted' => true,
                        ));
 
                        $text = "$load: $time";
index ba08180b19f0dd36e24999fdd9b861dfeeb62dc6..ab75bd09bf69feb2bbd35ff1c2ae78f5e8a43816 100644 (file)
@@ -21,6 +21,7 @@ $owner_icon = elgg_view_entity_icon($owner, 'tiny');
 $owner_link = elgg_view('output/url', array(
        'href' => "blog/owner/$owner->username",
        'text' => $owner->name,
+       'is_trusted' => true,
 ));
 $author_text = elgg_echo('byline', array($owner_link));
 $tags = elgg_view('output/tags', array('tags' => $blog->tags));
@@ -35,6 +36,7 @@ if ($blog->comments_on != 'Off') {
                $comments_link = elgg_view('output/url', array(
                        'href' => $blog->getURL() . '#blog-comments',
                        'text' => $text,
+                       'is_trusted' => true,
                ));
        } else {
                $comments_link = '';
index 7bbfc3c74339d6acbe259119bf11b73a791726fc..3301716624ec50b3774d6ebff003a2473cfdfb99 100644 (file)
@@ -22,6 +22,7 @@ if ($content) {
        $more_link = elgg_view('output/url', array(
                'href' => $blog_url,
                'text' => elgg_echo('blog:moreblogs'),
+               'is_trusted' => true,
        ));
        echo "<span class=\"elgg-widget-more\">$more_link</span>";
 } else {
index 3797de01015dde371e58e03515b8b87ed53da7db..60a7278195a395238e6125d6207ac0c71eb8ee75 100644 (file)
@@ -14,6 +14,7 @@ if ($group->bookmarks_enable == "no") {
 $all_link = elgg_view('output/url', array(
        'href' => "bookmarks/group/$group->guid/all",
        'text' => elgg_echo('link:view:all'),
+       'is_trusted' => true,
 ));
 
 elgg_push_context('widgets');
@@ -35,6 +36,7 @@ if (!$content) {
 $new_link = elgg_view('output/url', array(
        'href' => "bookmarks/add/$group->guid",
        'text' => elgg_echo('bookmarks:add'),
+       'is_trusted' => true,
 ));
 
 echo elgg_view('groups/profile/module', array(
index ca1f5d312a9a96636e512a5e92839fe9becb8426..78426323210cea1799014b97f466a473edceaecb 100644 (file)
@@ -17,12 +17,13 @@ $owner_icon = elgg_view_entity_icon($owner, 'tiny');
 $container = $bookmark->getContainerEntity();
 $categories = elgg_view('output/categories', $vars);
 
-$link = filter_tags(elgg_view('output/url', array('href' => $bookmark->address, 'rel' => 'nofollow')));
+$link = elgg_view('output/url', array('href' => $bookmark->address));
 $description = elgg_view('output/longtext', array('value' => $bookmark->description, 'class' => 'pbl'));
 
 $owner_link = elgg_view('output/url', array(
        'href' => "bookmarks/owner/$owner->username",
        'text' => $owner->name,
+       'is_trusted' => true,
 ));
 $author_text = elgg_echo('byline', array($owner_link));
 
@@ -36,6 +37,7 @@ if ($comments_count != 0) {
        $comments_link = elgg_view('output/url', array(
                'href' => $bookmark->getURL() . '#comments',
                'text' => $text,
+               'is_trusted' => true,
        ));
 } else {
        $comments_link = '';
@@ -104,11 +106,10 @@ HTML;
                }
        }
 
-       $link = filter_tags(elgg_view('output/url', array(
+       $link = elgg_view('output/url', array(
                'href' => $bookmark->address,
                'text' => $display_text,
-               'rel' => 'nofollow',
-       )));
+       ));
 
        $content = elgg_view_icon('push-pin-alt') . "$link{$excerpt}";
 
index ea7816345d36b868de1c6b86af6c9d3596033e01..0b85017fcc99c3496df1539c7ef48fd141cd0366 100644 (file)
@@ -24,6 +24,7 @@ if ($content) {
        $more_link = elgg_view('output/url', array(
                'href' => $url,
                'text' => elgg_echo('bookmarks:more'),
+               'is_trusted' => true,
        ));
        echo "<span class=\"elgg-widget-more\">$more_link</span>";
 } else {
index 1a0b54c882bfd1c8a83185e74fd0bd34e8170345..35d8ccbfdaf7b415ab6255a5a23a58ff51849367 100644 (file)
@@ -17,6 +17,7 @@
                'text' => elgg_echo('theme_preview:breakout'),
                'href' => current_page_url(),
                'target' => '_parent',
+               'is_trusted' => true,
        ));
 ?>
 </p>
index 76f12b0ae7a390c213bcadfaf3ed84c8649e9eee..b41907da2b36813f848b6a28a6642e0b4620c0ce 100644 (file)
@@ -18,6 +18,7 @@ if (elgg_get_config('debug')) {
                'text' => elgg_echo('diagnostics:test:executeall'),
                'href' => 'engine/tests/suite.php',
                'class' => 'elgg-button elgg-button-submit',
+               'is_trusted' => true,
        );
        $unit_tests .= '<p>' . elgg_view('output/url', $params) . '</p>';
 } else {
index c37b13927602127a32ff05ee318ee8138e9ce3ce..ad6c58dbbbc83bc9faee9ac8b18810a44ce892d5 100644 (file)
@@ -12,6 +12,7 @@ if ($group->file_enable == "no") {
 $all_link = elgg_view('output/url', array(
        'href' => "file/group/$group->guid/all",
        'text' => elgg_echo('link:view:all'),
+       'is_trusted' => true,
 ));
 
 elgg_push_context('widgets');
@@ -33,6 +34,7 @@ if (!$content) {
 $new_link = elgg_view('output/url', array(
        'href' => "file/add/$group->guid",
        'text' => elgg_echo('file:add'),
+       'is_trusted' => true,
 ));
 
 echo elgg_view('groups/profile/module', array(
index 7feba7af3e7e8af0ebe349b8ce3b233d56e8ad6d..ff729da94d99a1c2fc17e55b6ad547641b10705c 100644 (file)
@@ -36,6 +36,7 @@ if ($url) {
        $params = array(
                'href' => $url,
                'text' => $img,
+               'is_trusted' => true,
        );
        if (isset($vars['link_class'])) {
                $params['class'] = $vars['link_class'];
index 95e190d3586a4e58aa5d1ccd9e68933e5523b476..fbd585b8aece53741c64f6fd8ba2d7fd6ff24b8a 100644 (file)
@@ -24,6 +24,7 @@ $body = elgg_view('output/longtext', array('value' => $file->description));
 $owner_link = elgg_view('output/url', array(
        'href' => "file/owner/$owner->username",
        'text' => $owner->name,
+       'is_trusted' => true,
 ));
 $author_text = elgg_echo('byline', array($owner_link));
 
@@ -39,6 +40,7 @@ if ($comments_count != 0) {
        $comments_link = elgg_view('output/url', array(
                'href' => $file->getURL() . '#file-comments',
                'text' => $text,
+               'is_trusted' => true,
        ));
 } else {
        $comments_link = '';
index 4288b9e5620a6bdb61ed28d7152e518fb4614650..f3e152de34d97d6a1a08340e6f2df189c283b45d 100644 (file)
@@ -25,6 +25,7 @@ if ($content) {
        $more_link = elgg_view('output/url', array(
                'href' => $url,
                'text' => elgg_echo('file:more'),
+               'is_trusted' => true,
        ));
        echo "<span class=\"elgg-widget-more\">$more_link</span>";
 } else {
index 3a46e336ecf8206ccda89804da3e8e0dd9c93e00..3c9961f828d114e1824f289dc99a8263237cd636 100644 (file)
@@ -15,6 +15,7 @@ $group = $vars['entity'];
 $all_link = elgg_view('output/url', array(
        'href' => "discussion/owner/$group->guid",
        'text' => elgg_echo('link:view:all'),
+       'is_trusted' => true,
 ));
 
 elgg_push_context('widgets');
@@ -36,6 +37,7 @@ if (!$content) {
 $new_link = elgg_view('output/url', array(
        'href' => "discussion/add/" . $group->getGUID(),
        'text' => elgg_echo('groups:addtopic'),
+       'is_trusted' => true,
 ));
 
 echo elgg_view('groups/profile/module', array(
index 9c2df8b9ce40b9fcff7a2f9ef00041399eefac8e..e644b6bdc214b92a7906053b0afc21ab874a4ae7 100644 (file)
@@ -15,6 +15,7 @@ if (!empty($vars['invitations']) && is_array($vars['invitations'])) {
                        $group_title = elgg_view('output/url', array(
                                'href' => $group->getURL(),
                                'text' => $group->name,
+                               'is_trusted' => true,
                        ));
 
                        $url = elgg_add_action_tokens_to_url(elgg_get_site_url()."action/groups/join?user_guid={$user->guid}&group_guid={$group->guid}");
@@ -22,6 +23,7 @@ if (!empty($vars['invitations']) && is_array($vars['invitations'])) {
                                'href' => $url,
                                'text' => elgg_echo('accept'),
                                'class' => 'elgg-button elgg-button-submit',
+                               'is_trusted' => true,
                        ));
 
                        $url = "action/groups/killinvitation?user_guid={$user->getGUID()}&group_guid={$group->getGUID()}";
index 7f33b83e0f7d12560ba8a5167885dff3aacea6e1..489d6f5e3be6c2103ebda9fdc8d2af218826108a 100644 (file)
@@ -16,6 +16,7 @@ if (!empty($vars['requests']) && is_array($vars['requests'])) {
                        $user_title = elgg_view('output/url', array(
                                'href' => $user->getURL(),
                                'text' => $user->name,
+                               'is_trusted' => true,
                        ));
 
                        $url = "action/groups/addtogroup?user_guid={$user->guid}&group_guid={$vars['entity']->guid}";
@@ -24,6 +25,7 @@ if (!empty($vars['requests']) && is_array($vars['requests'])) {
                                'href' => $url,
                                'text' => elgg_echo('accept'),
                                'class' => 'elgg-button elgg-button-submit',
+                               'is_trusted' => true,
                        ));
 
                        $url = 'action/groups/killrequest?user_guid=' . $user->guid . '&group_guid=' . $vars['entity']->guid;
index 5e557b443a4bf37d3078a9f5fe7ff1f224f197cc..832ff4a4b83d910880db2a11d38288eccc89eaaf 100644 (file)
@@ -19,6 +19,7 @@ if (!$group) {
 $all_link = elgg_view('output/url', array(
        'href' => "groups/activity/$group->guid",
        'text' => elgg_echo('link:view:all'),
+       'is_trusted' => true,
 ));
 
 
index b7ae51070ad3913d5a971a8efd1f721fd1ae51bb..54abcb1e55ea096bababd0a3faeb14bbd46d0e29 100644 (file)
@@ -28,6 +28,7 @@ $owner = $group->getOwnerEntity();
                                        echo elgg_view('output/url', array(
                                                'text' => $owner->name,
                                                'value' => $owner->getURL(),
+                                               'is_trusted' => true,
                                        ));
                                ?>
                        </p>
index 7249ffbf4b3a7254655d7b61655bd654a5dd21cf..49f14697c969edfa322f92da5710547e880ec797 100644 (file)
@@ -13,6 +13,7 @@ $limit = elgg_extract('limit', $vars, 10);
 $all_link = elgg_view('output/url', array(
        'href' => 'groups/members/' . $vars['entity']->guid,
        'text' => elgg_echo('groups:members:more'),
+       'is_trusted' => true,
 ));
 
 $body = elgg_list_entities_from_relationship(array(
index 22589b84d675ade5cd5a980c4801adb385bfde13..f3d5f96d5372d768f4f7d632b0c9b83db0fdc981 100644 (file)
@@ -20,6 +20,7 @@ $poster_icon = elgg_view_entity_icon($poster, 'tiny');
 $poster_link = elgg_view('output/url', array(
        'href' => $poster->getURL(),
        'text' => $poster->name,
+       'is_trusted' => true,
 ));
 $poster_text = elgg_echo('groups:started', array($poster->name));
 
@@ -42,6 +43,7 @@ if ($num_replies != 0) {
        $replies_link = elgg_view('output/url', array(
                'href' => $topic->getURL() . '#group-replies',
                'text' => elgg_echo('group:replies') . " ($num_replies)",
+               'is_trusted' => true,
        ));
 }
 
index 114fd75653e3d459bdb0b0c79f3918151e7d6732..fe1a46e39ec03b9f3fd90adea54e33ab4d604ee6 100644 (file)
@@ -25,6 +25,7 @@ if ($content) {
        $more_link = elgg_view('output/url', array(
                'href' => $url,
                'text' => elgg_echo('groups:more'),
+               'is_trusted' => true,
        ));
        echo "<span class=\"elgg-widget-more\">$more_link</span>";
 } else {
index 2dd01b6cd22915b36a8ef3cb0f116c818f519239..314d0790d1a0666995df0da835d494dcd6a8c0d3 100644 (file)
@@ -20,6 +20,7 @@ $user_icon = elgg_view_entity_icon($user, 'tiny');
 $user_link = elgg_view('output/url', array(
        'href' => $user->getURL(),
        'text' => $user->name,
+       'is_trusted' => true,
 ));
 
 $likes_string = elgg_echo('likes:this');
index 383e1bb63796c03fadc2239c35bda378e8eb5902..3f2f073ccb262f5e0c794536cbe50c1a69bb9232 100644 (file)
@@ -20,6 +20,7 @@ if (elgg_is_logged_in() && $vars['entity']->canAnnotate(0, 'likes')) {
                        'text' => elgg_view_icon('thumbs-up'),
                        'title' => elgg_echo('likes:likethis'),
                        'is_action' => true,
+                       'is_trusted' => true,
                );
                $likes_button = elgg_view('output/url', $params);
        } else {
@@ -34,6 +35,7 @@ if (elgg_is_logged_in() && $vars['entity']->canAnnotate(0, 'likes')) {
                        'text' => elgg_view_icon('thumbs-up-alt'),
                        'title' => elgg_echo('likes:remove'),
                        'is_action' => true,
+                       'is_trusted' => true,
                );
                $likes_button = elgg_view('output/url', $params);
        }
index 86c8a14238bd9fb29a550e3003a47e0f5485fab8..b7f6a1f20f80bb512cfde0c723e9058ff2127cba 100644 (file)
@@ -24,11 +24,13 @@ $log_entries = $vars['log_entries'];
                if ($user) {
                        $user_link = elgg_view('output/url', array(
                                'href' => $user->getURL(),
-                               'text' => $user->name
+                               'text' => $user->name,
+                               'is_trusted' => true,
                        ));
                        $user_guid_link = elgg_view('output/url', array(
                                'href' => "admin/overview/logbrowser?user_guid=$user->guid",
-                               'text' => $user->getGUID()
+                               'text' => $user->getGUID(),
+                               'is_trusted' => true,
                        ));
                } else {
                        $user_guid_link = $user_link = '&nbsp;';
@@ -38,7 +40,8 @@ $log_entries = $vars['log_entries'];
                if (is_callable(array($object, 'getURL'))) {
                        $object_link = elgg_view('output/url', array(
                                'href' => $object->getURL(),
-                               'text' => $entry->object_class
+                               'text' => $entry->object_class,
+                               'is_trusted' => true,
                        ));
                } else {
                        $object_link = $entry->object_class;
index 63f389e6a8dfda5efbb38fa196ffc954bc59ae7d..35954e7a3f885876fcab0f45ee53f28752d92729 100644 (file)
@@ -31,4 +31,5 @@ if ($owner instanceof ElggGroup) {
 echo elgg_view('output/url', array(
        'href' => $url,
        'text' => elgg_echo('messageboard:viewall'),
+       'is_trusted' => true,
 ));
\ No newline at end of file
index b6f9ed6d50d3273b454a7ee78daf87a0ee293cdd..8c840dd57be9f84534871c2ff857171cb4a05669 100644 (file)
@@ -24,6 +24,7 @@ if ($message->toId == elgg_get_page_owner_guid()) {
                $user_link = elgg_view('output/url', array(
                        'href' => "messages/compose?send_to=$user->guid",
                        'text' => $user->name,
+                       'is_trusted' => true,
                ));
        } else {
                $icon = '';
@@ -45,6 +46,7 @@ if ($message->toId == elgg_get_page_owner_guid()) {
                $user_link = elgg_view('output/url', array(
                        'href' => "messages/compose?send_to=$user->guid",
                        'text' => elgg_echo('messages:to_user', array($user->name)),
+                       'is_trusted' => true,
                ));
        } else {
                $icon = '';
@@ -63,6 +65,7 @@ if (!$full) {
 $subject_info .= elgg_view('output/url', array(
        'href' => $message->getURL(),
        'text' => $message->title,
+       'is_trusted' => true,
 ));
 
 $delete_link = elgg_view("output/confirmlink", array(
index f7a7a78a1545f0b00edcdb9d9bba15399b90019d..a621b9281096a923abc7280be3d94fc3f9082d49 100644 (file)
@@ -21,6 +21,7 @@ if (!$owner) {
 $owner_link = elgg_view('output/url', array(
        'href' => $owner->getURL(),
        'text' => $owner->name,
+       'is_trusted' => true,
 ));
 
 $date = elgg_view_friendly_time($annotation->time_created);
@@ -28,6 +29,7 @@ $date = elgg_view_friendly_time($annotation->time_created);
 $title_link = elgg_view('output/url', array(
        'href' => $annotation->getURL(),
        'text' => $page->title,
+       'is_trusted' => true,
 ));
 
 $subtitle = elgg_echo('pages:revision:subtitle', array($date, $owner_link));
index 8ba9fc298a2201bc992c1d6a270d19aae37ddb4c..0f7b51a0e84140a7cd64b81afc583305a995bee8 100644 (file)
@@ -40,6 +40,7 @@ $editor = get_entity($annotation->owner_guid);
 $editor_link = elgg_view('output/url', array(
        'href' => "pages/owner/$editor->username",
        'text' => $editor->name,
+       'is_trusted' => true,
 ));
 
 $date = elgg_view_friendly_time($annotation->time_created);
@@ -53,6 +54,7 @@ if ($comments_count != 0 && !$revision) {
        $comments_link = elgg_view('output/url', array(
                'href' => $page->getURL() . '#page-comments',
                'text' => $text,
+               'is_trusted' => true,
        ));
 } else {
        $comments_link = '';
index 7e2656ca3bf600ef8ef968c2530230b637fa8a3d..0d7df96acaa1d97fe77466e0c7c45c7f7c7ec447 100644 (file)
@@ -15,6 +15,7 @@ if ($group->pages_enable == "no") {
 $all_link = elgg_view('output/url', array(
        'href' => "pages/group/$group->guid/all",
        'text' => elgg_echo('link:view:all'),
+       'is_trusted' => true,
 ));
 
 
@@ -37,6 +38,7 @@ if (!$content) {
 $new_link = elgg_view('output/url', array(
        'href' => "pages/add/$group->guid",
        'text' => elgg_echo('pages:add'),
+       'is_trusted' => true,
 ));
 
 echo elgg_view('groups/profile/module', array(
index 3ae0b8454a3cdf04f96cfc8e6c2c8661d45fa0c7..f63777c097f0d77011edca81813b0120496c0c09 100644 (file)
@@ -24,6 +24,7 @@ if ($content) {
        $more_link = elgg_view('output/url', array(
                'href' => $url,
                'text' => elgg_echo('pages:more'),
+               'is_trusted' => true,
        ));
        echo "<span class=\"elgg-widget-more\">$more_link</span>";
 } else {
index 6bcbf6e5d7747426acd6fd70d1eda4bb4b199482..0e733e154b44446bba6c4e1777078f7c01dfcca7 100644 (file)
@@ -29,6 +29,7 @@ if ($report->state == 'archived') {
                        'href' => $archive_url,
                        'text' => elgg_echo('reportedcontent:archive'),
                        'is_action' => true,
+                       'is_trusted' => true,
                        'class' => 'elgg-button elgg-button-action',
                );
                echo elgg_view('output/url', $params);
@@ -37,6 +38,7 @@ if ($report->state == 'archived') {
                'href' => $delete_url,
                'text' => elgg_echo('reportedcontent:delete'),
                'is_action' => true,
+               'is_trusted' => true,
                'class' => 'elgg-button elgg-button-action',
        );
        echo elgg_view('output/url', $params);
@@ -46,7 +48,8 @@ if ($report->state == 'archived') {
                        <b><?php echo elgg_echo('reportedcontent:by'); ?>:</b>
                        <?php echo elgg_view('output/url', array(
                                'href' => $reporter->getURL(),
-                               'text' => $reporter->name
+                               'text' => $reporter->name,
+                               'is_trusted' => true,
                        ));
                        ?>,
                        <?php echo elgg_view_friendly_time($report->time_created); ?>
@@ -68,7 +71,8 @@ if ($report->state == 'archived') {
                        <b><?php echo elgg_echo('reportedcontent:objecturl'); ?>:</b>
                        <?php echo elgg_view('output/url', array(
                                'href' => $report->address,
-                               'text' => elgg_echo('reportedcontent:visit')
+                               'text' => elgg_echo('reportedcontent:visit'),
+                               'is_trusted' => true,
                        ));
                        ?>
                </p>
index 2727df60da7cfe6ae8f13a855940c3d256890812..134c872435b5cf559399cf3b32018feea54f8980 100644 (file)
@@ -26,6 +26,7 @@ $owner_icon = elgg_view_entity_icon($owner, 'tiny');
 $owner_link = elgg_view('output/url', array(
        'href' => "thewire/owner/$owner->username",
        'text' => $owner->name,
+       'is_trusted' => true,
 ));
 $author_text = elgg_echo('byline', array($owner_link));
 $date = elgg_view_friendly_time($post->time_created);
index c3c43485859e1155abb8cbad49de0148151dcdec..fbf59266440e931e96957fa95aa2a3ea5742090c 100644 (file)
@@ -12,12 +12,14 @@ $subject_link = elgg_view('output/url', array(
        'href' => $subject->getURL(),
        'text' => $subject->name,
        'class' => 'elgg-river-subject',
+       'is_trusted' => true,
 ));
 
 $object_link = elgg_view('output/url', array(
        'href' => "thewire/owner/$subject->username",
        'text' => elgg_echo('thewire:wire'),
        'class' => 'elgg-river-object',
+       'is_trusted' => true,
 ));
 
 $summary = elgg_echo("river:create:object:thewire", array($subject_link, $object_link));
index 6ab47bccbe1a678e073e5d79b92296729c474386..ab20b534138f2ea0174812189c20a0c66a687b8f 100644 (file)
@@ -28,6 +28,7 @@ if ($latest_wire && count($latest_wire) > 0) {
                        'text' => elgg_echo('thewire:update'),
                        'href' => $url_to_wire,
                        'class' => 'elgg-button elgg-button-action right',
+                       'is_trusted' => true,
                ));
        }
 
index 835a328b0ab8a7453d26abdc8c26116fff3b3dcb..7212d4397e6835c7885eba1bdcb1ce4ab84e9177 100644 (file)
@@ -22,6 +22,7 @@ if ($content) {
        $more_link = elgg_view('output/url', array(
                'href' => $owner_url,
                'text' => elgg_echo('thewire:moreposts'),
+               'is_trusted' => true,
        ));
        echo "<span class=\"elgg-widget-more\">$more_link</span>";
 } else {
index fdeafd46d116c246317d9e398d7fbf17a950d3e4..2592013c6d35656b7c2d7e14140fc40e0f40fdad 100644 (file)
@@ -58,4 +58,5 @@ echo elgg_view('output/url', array(
        'class' => 'right',
        'text' => elgg_echo('twitter_api:interstitial:no_thanks'),
        'href' => '/',
+       'is_trusted' => true,
 ));
\ No newline at end of file
index 2872b7a0c298fe3248f18ef50e55d0f1dc7c0454..0e1461058bd57a50e4d8f92731c4c8ea5819c902 100644 (file)
@@ -52,27 +52,30 @@ $bulk_actions_checkbox = '<label><input type="checkbox" class="unvalidated-users
        . elgg_echo('uservalidationbyemail:check_all') . '</label>';
 
 $validate = elgg_view('output/url', array(
-       'is_action' => TRUE,
-       'js' => 'title="' . elgg_echo('uservalidationbyemail:confirm_validate_checked') . '"',
-       'href' => $vars['url'] . "action/uservalidationbyemail/validate/",
+       'href' => 'action/uservalidationbyemail/validate/',
        'text' => elgg_echo('uservalidationbyemail:admin:validate'),
+       'title' => elgg_echo('uservalidationbyemail:confirm_validate_checked'),
        'class' => 'unvalidated-users-bulk-post',
+       'is_action' => true,
+       'is_trusted' => true,
 ));
 
 $resend_email = elgg_view('output/url', array(
-       'is_action' => TRUE,
-       'js' => 'title="' . elgg_echo('uservalidationbyemail:confirm_resend_validation_checked') . '"',
-       'href' => $vars['url'] . "action/uservalidationbyemail/resend_validation/",
+       'href' => 'action/uservalidationbyemail/resend_validation/',
        'text' => elgg_echo('uservalidationbyemail:admin:resend_validation'),
+       'title' => elgg_echo('uservalidationbyemail:confirm_resend_validation_checked'),
        'class' => 'unvalidated-users-bulk-post',
+       'is_action' => true,
+       'is_trusted' => true,
 ));
 
 $delete = elgg_view('output/url', array(
-       'is_action' => TRUE,
-       'js' => 'title="' . elgg_echo('uservalidationbyemail:confirm_delete_checked') . '"',
-       'href' => $vars['url'] . "action/uservalidationbyemail/delete/",
+       'href' => 'action/uservalidationbyemail/delete/',
        'text' => elgg_echo('uservalidationbyemail:admin:delete'),
+       'title' => elgg_echo('uservalidationbyemail:confirm_delete_checked'),
        'class' => 'unvalidated-users-bulk-post',
+       'is_action' => true,
+       'is_trusted' => true,
 ));
 
 $bulk_actions = <<<___END
index 4416dc8f666d35d226962454bf902fa7f40cc2ea..1bf5791ac1288acb52ec1a1c38a48c76d9c0a766 100644 (file)
@@ -17,6 +17,7 @@ if ($object) {
                'text' => elgg_echo('upgrade'),
                'href' => 'action/widgets/upgrade',
                'is_action' => true,
+               'is_trusted' => true,
                'class' => 'elgg_button elgg-button-submit',
                'title' => 'Upgrade your default widgets to work on Elgg 1.8',
        ));
index 6e79838ea40e85bbc8b6cbc0125bd814e09b0770..f4ff1e98691cb6997d7f9251986562fcdf793ad4 100644 (file)
@@ -39,8 +39,9 @@ foreach ($items as $item) {
        //$even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even';
        $url = elgg_view('output/url', array(
                'href' => "action/profile/fields/delete?id={$item->shortname}",
-               'is_action' => TRUE,
                'text' => elgg_view_icon('delete-alt'),
+               'is_action' => true,
+               'is_trusted' => true,
        ));
        $type = elgg_echo($item->type);
        echo <<<HTML
index 3919c017ef843ed1a6a377d4ead1ad8c24e41976..331190a88da1c92744343022c540fee11ef6f207 100644 (file)
@@ -7,10 +7,12 @@ $admin_title = elgg_get_site_entity()->name . ' ' . elgg_echo('admin');
 $view_site = elgg_view('output/url', array(
        'href' => elgg_get_site_url(),
        'text' => elgg_echo('admin:view_site'),
+       'is_trusted' => true,
 ));
 $logout = elgg_view('output/url', array(
        'href' => 'action/logout',
        'text' => elgg_echo('logout'),
+       'is_trusted' => true,
 ));
 ?>
 <h1 class="elgg-heading-site">
index 3abd96b96035b24af73efece6979d3300b990403..533b92c433ea0b66da05e95208212a4611a407a8 100644 (file)
@@ -39,6 +39,7 @@ if ($url) {
        echo elgg_view('output/url', array(
                'href' => $url,
                'text' => $img,
+               'is_trusted' => true,
        ));
 } else {
        echo $img;
index aca03521ff43959723b46f6970ca2808f82eefcf..0eb3691bd3271cfa603459b777128cde1ed0ea30 100644 (file)
@@ -66,6 +66,7 @@ if ($show_menu) {
 echo elgg_view('output/url', array(
        'href' => $user->getURL(),
        'text' => $icon,
+       'is_trusted' => true,
 ));
 ?>
 </div>
index bad73c4b3431fd21a887fff3cf32a5602aa178ce..88577a8ffe6d5e506c3de4b69411a35ce71a44e7 100644 (file)
@@ -30,6 +30,7 @@ if (is_array($breadcrumbs) && count($breadcrumbs) > 0) {
                        $crumb = elgg_view('output/url', array(
                                'href' => $breadcrumb['link'],
                                'text' => $breadcrumb['title'],
+                               'is_trusted' => true,
                        ));
                } else {
                        $crumb = $breadcrumb['title'];
index e32e5ab578095ba77ebe5120f610979811353b46..5c89e585c1e92ba0704382c44a9fcb733ccb6620 100644 (file)
@@ -19,6 +19,7 @@ echo '<ul class="elgg-menu elgg-menu-hover">';
 $name_link = elgg_view('output/url', array(
        'href' => $user->getURL(),
        'text' => "<span class=\"elgg-heading-basic\">$user->name</span>&#64;$user->username",
+       'is_trusted' => true,
 ));
 echo "<li>$name_link</li>";
 
index c0cb801dd5068d756141aa5b5ad9cb814570eb33..4df5cf575f379cf4c274b6ebe9983eb3242a7d0b 100644 (file)
@@ -42,10 +42,12 @@ $pages = new stdClass();
 $pages->prev = array(
        'text' => '&laquo; ' . elgg_echo('previous'),
        'href' => '',
+       'is_trusted' => true,
 );
 $pages->next = array(
        'text' => elgg_echo('next') . ' &raquo;',
        'href' => '',
+       'is_trusted' => true,
 );
 $pages->items = array();
 
index 0108126ad7a5ea55b9abe1b14afba89dddcee0e6..e8fde35796b32f7103c7d7bfdb463cb5cabda094 100644 (file)
@@ -47,7 +47,7 @@ if (isset($vars['tabs']) && is_array($vars['tabs']) && !empty($vars['tabs'])) {
                $options = array(
                        'href' => $url,
                        'title' => $title,
-                       'text' => $title
+                       'text' => $title,
                );
 
                if (isset($info['url_class'])) {
@@ -58,6 +58,10 @@ if (isset($vars['tabs']) && is_array($vars['tabs']) && !empty($vars['tabs'])) {
                        $options['id'] = $info['url_id'];
                }
 
+               if (!isset($info['rel']) && !isset($info['is_trusted'])) {
+                       $options['is_trusted'] = true;
+               }
+
                $link = elgg_view('output/url', $options);
 
                echo "<li $class_str $js>$link</li>";
index 086eddb1fa5f5e7b1d8685b9bdbd74c2734decb1..11524567ed9d1435159054911df0d34032676df9 100644 (file)
@@ -11,7 +11,8 @@ if (isset($vars['entity']) && elgg_instanceof($vars['entity'], 'object', 'admin_
                'href' => "action/admin/delete_admin_notice?guid=$notice->guid",
                'text' => '<span class="elgg-icon elgg-icon-delete"></span>',
                'is_action' => true,
-               'class' => 'elgg-admin-notice'
+               'class' => 'elgg-admin-notice',
+               'is_trusted' => true,
        ));
 
        echo "<p>$delete$message</p>";
index a50f193875c370d8b8739f33a8ec3928b71dc535..a9c3e15caee7ad963395f7918eb74f4631e48f48 100644 (file)
@@ -28,6 +28,7 @@ if ($owner) {
        $owner_link = elgg_view('output/url', array(
                'href' => $owner->getURL(),
                'text' => $owner->name,
+               'is_trusted' => true,
        ));
 }
 
index 10cf0b1482292461f7f78b9f1dca0c4c5cda87f0..3ca4de2be216d894f9a9d5cf37fca4527618062e 100644 (file)
@@ -29,6 +29,7 @@ if ($title_link === '') {
        $params = array(
                'text' => $text,
                'href' => $entity->getURL(),
+               'is_trusted' => true,
        );
        $title_link = elgg_view('output/url', $params);
 }
index 1fabaff041be235ff1e5e2001f42a1c6684c2c69..db4e4dbcc4e1a33bd60dc8cc70d486810de120f6 100644 (file)
@@ -40,9 +40,10 @@ if ($reordering) {
                ));
 
                $links .= "<li>" . elgg_view('output/url', array(
-                       'href'          => $top_url,
-                       'text'          => elgg_echo('top'),
-                       'is_action'     => true
+                       'href' => $top_url,
+                       'text' => elgg_echo('top'),
+                       'is_action' => true,
+                       'is_trusted' => true,
                )) . "</li>";
 
                $up_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array(
@@ -52,9 +53,10 @@ if ($reordering) {
                ));
 
                $links .= "<li>" . elgg_view('output/url', array(
-                       'href'          => $up_url,
-                       'text'          => elgg_echo('up'),
-                       'is_action'     => true
+                       'href' => $up_url,
+                       'text' => elgg_echo('up'),
+                       'is_action' => true,
+                       'is_trusted' => true,
                )) . "</li>";
        }
 
@@ -67,9 +69,10 @@ if ($reordering) {
                ));
 
                $links .= "<li>" . elgg_view('output/url', array(
-                       'href'          => $down_url,
-                       'text'          => elgg_echo('down'),
-                       'is_action'     => true
+                       'href' => $down_url,
+                       'text' => elgg_echo('down'),
+                       'is_action'     => true,
+                       'is_trusted' => true,
                )) . "</li>";
 
                $bottom_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array(
@@ -81,7 +84,8 @@ if ($reordering) {
                $links .= "<li>" . elgg_view('output/url', array(
                        'href'          => $bottom_url,
                        'text'          => elgg_echo('bottom'),
-                       'is_action'     => true
+                       'is_action'     => true,
+                       'is_trusted' => true,
                )) . "</li>";
        }
 } else {
@@ -93,7 +97,8 @@ if ($reordering) {
 
 // always let them deactivate
 $options = array(
-       'is_action' => true
+       'is_action' => true,
+       'is_trusted' => true,
 );
 if ($active) {
        $active_class = 'elgg-state-active';
@@ -163,7 +168,8 @@ $author = '<span>' . elgg_echo('admin:plugins:label:author') . '</span>: '
 $version = htmlspecialchars($plugin->getManifest()->getVersion());
 $website = elgg_view('output/url', array(
        'href' => $plugin->getManifest()->getWebsite(),
-       'text' => $plugin->getManifest()->getWebsite()
+       'text' => $plugin->getManifest()->getWebsite(),
+       'is_trusted' => true,
 ));
 
 $copyright = elgg_view('output/text', array('value' => $plugin->getManifest()->getCopyright()));
@@ -179,7 +185,8 @@ if ($files) {
                $url = 'admin_plugin_text_file/' . $plugin->getID() . "/$file";
                $link = elgg_view('output/url', array(
                        'text' => $file,
-                       'href' => $url
+                       'href' => $url,
+                       'is_trusted' => true,
                ));
                $docs .= "<li>$link</li>";
 
index f4cc944f4ab392768a9bef09e9bd62b829b64aa4..4d392e71af3de5e7358187258c4f7625229b79ce 100644 (file)
@@ -49,7 +49,8 @@ foreach ($files as $file => $path) {
        $url = 'admin_plugin_text_file/' . $plugin->getID() . "/$file";
        $link = elgg_view('output/url', array(
                'text' => $file,
-               'href' => $url
+               'href' => $url,
+               'is_trusted' => true,
        ));
        $plugin_footer .= "<li>$link</li>";
 
index abf2154fca6600718b6767845e7f6a6678ba9e43..6d06d28bc03fbe8058f1884c2af7d204cf7ba560 100644 (file)
@@ -24,6 +24,7 @@ if ($widget->canEdit()) {
                'title' => elgg_echo('widget:delete', array($widget->getTitle())),
                'href' => "action/widgets/delete?guid=$widget->guid",
                'is_action' => true,
+               'is_trusted' => true,
                'class' => 'elgg-widget-delete-button',
                'id' => "elgg-widget-delete-button-$widget->guid"
        );
index abae9c4b274627c676426071671f1a3cb7c7e1bf..3c002a31b593790d13e2926caec5b63d03280d53 100644 (file)
@@ -26,5 +26,9 @@ if (isset($vars['value'])) {
                $type = "";
        }
        $url = elgg_get_site_url() . 'search?q=' . urlencode($vars['value']) . "&search_type=tags{$type}{$subtype}{$object}";
-       echo elgg_view('output/url', array('href' => $url, 'text' => $vars['value'], 'rel' => 'tag'));
+       echo elgg_view('output/url', array(
+               'href' => $url,
+               'text' => $vars['value'],
+               'rel' => 'tag',
+       ));
 }
index 79ab5237716670e7838e0227bc0e5e533ab7aa7f..81b02087d2a6af5b2540e2d7683190b8cb5f6844 100644 (file)
@@ -10,7 +10,7 @@
  * @uses string $vars['href']        The unencoded url string
  * @uses bool   $vars['encode_text'] Run $vars['text'] through htmlspecialchars() (false)
  * @uses bool   $vars['is_action']   Is this a link to an action (false)
- *
+ * @uses bool   $vars['is_trusted']  Is this link trusted (false)
  */
 
 $url = elgg_extract('href', $vars, null);
@@ -37,11 +37,20 @@ if ($url) {
 
        if (elgg_extract('is_action', $vars, false)) {
                $url = elgg_add_action_tokens_to_url($url, false);
-               unset($vars['is_action']);
+       }
+
+       if (!elgg_extract('is_trusted', $vars, false)) {
+               if (!isset($vars['rel'])) {
+                       $vars['rel'] = 'nofollow';
+                       $url = strip_tags($url);
+               }
        }
 
        $vars['href'] = $url;
 }
 
+unset($vars['is_action']);
+unset($vars['is_trusted']);
+
 $attributes = elgg_format_attributes($vars);
-echo "<a $attributes>$text</a>";
\ No newline at end of file
+echo "<a $attributes>$text</a>";
index 06fdb84a590154d7314e4bee7afd9d8d0a891d2e..596d17bd3c857055f2dd6774351dd58296789f3d 100644 (file)
@@ -17,5 +17,6 @@ echo elgg_view('output/url', array(
        'href' => 'http://elgg.org',
        'text' => "<img src=\"$powered_url\" alt=\"Powered by Elgg\" width=\"106\" height=\"15\" />",
        'class' => '',
+       'is_trusted' => true,
 ));
 echo '</div>';
index 8b67c9e371237479f502b5c2bd72ba03df829143..258951c41ff18729ba07b3a9782f5ac1b6f23ac6 100644 (file)
@@ -50,6 +50,7 @@ $cloud .= elgg_view_icon('tag');
 $cloud .= elgg_view('output/url', array(
        'href' => 'tags',
        'text' => elgg_echo('tagcloud:allsitetags'),
+       'is_trusted' => true,
 ));
 $cloud .= '</p>';
 
index 89e83b09641235227d4ffb23d524e175f78af4c9..c33a45f99b8d3f38959f1bf549741c81ede7d4b7 100644 (file)
@@ -10,6 +10,7 @@
                'text' => elgg_echo('widgets:add'),
                'class' => 'elgg-button elgg-button-action',
                'rel' => 'toggle',
+               'is_trusted' => true,
        ));
 ?>
 </div>
index c5a525733ead27155e6eff562f7cfc98870b15ff..6894b81e28835af520a5cb9f40fc2b3cd78821ca 100644 (file)
@@ -27,6 +27,7 @@ if ($summary === false) {
                'href' => $subject->getURL(),
                'text' => $subject->name,
                'class' => 'elgg-river-subject',
+               'is_trusted' => true,
        ));
 }
 
@@ -52,6 +53,7 @@ if ($container instanceof ElggGroup && $container->guid != elgg_get_page_owner_g
        $group_link = elgg_view('output/url', array(
                'href' => $container->getURL(),
                'text' => $container->name,
+               'is_trusted' => true,
        ));
        $group_string = elgg_echo('river:ingroup', array($group_link));
 }
index 8c5be6316e9e92305d5bbb3bb52bbf6f89b3228f..f6c32e1424370746e72fdf0226e7e9bb796402b3 100644 (file)
@@ -50,6 +50,7 @@ if ($comments) {
                $params = array(
                        'href' => $url,
                        'text' => elgg_echo('river:comments:more', array($num_more_comments)),
+                       'is_trusted' => true,
                );
                $link = elgg_view('output/url', $params);
                echo "<div class=\"elgg-river-more\">$link</div>";
index 4d80c29a69d448be3b3f7b8e9303f890ade09cfa..84941131f6b2f4a89c65d99a873525f5fe346eb2 100644 (file)
@@ -15,12 +15,14 @@ $subject_link = elgg_view('output/url', array(
        'href' => $subject->getURL(),
        'text' => $subject->name,
        'class' => 'elgg-river-subject',
+       'is_trusted' => true,
 ));
 
 $object_link = elgg_view('output/url', array(
        'href' => $object->getURL(),
        'text' => $object->title ? $object->title : $object->name,
        'class' => 'elgg-river-object',
+       'is_trusted' => true,
 ));
 
 $action = $item->action_type;
@@ -32,6 +34,7 @@ if ($container instanceof ElggGroup) {
        $params = array(
                'href' => $container->getURL(),
                'text' => $container->name,
+               'is_trusted' => true,
        );
        $group_link = elgg_view('output/url', $params);
        $group_string = elgg_echo('river:ingroup', array($group_link));
index c7f691533b5e418c23815a023f58b4df4b5d61ea..5c96747bdf976c3ed29a4a5bf672c8c9535e229a 100644 (file)
@@ -10,6 +10,7 @@ $subject_link = elgg_view('output/url', array(
        'href' => $subject->getURL(),
        'text' => $subject->name,
        'class' => 'elgg-river-subject',
+       'is_trusted' => true,
 ));
 
 $string = elgg_echo('river:update:user:avatar', array($subject_link));
index a344131d667b2f71aa31529ae945f8afc3ecc224..69b69b10606b3908c7803c4a0a29ff78c131d488 100644 (file)
@@ -9,6 +9,7 @@ $subject_link = elgg_view('output/url', array(
        'href' => $subject->getURL(),
        'text' => $subject->name,
        'class' => 'elgg-river-subject',
+       'is_trusted' => true,
 ));
 
 $string = elgg_echo('river:update:user:profile', array($subject_link));
index 6a652166c2ffbd4da19a86c7ad9666e7b34a585a..56772047dc35deb152f43bab207c0b26e9d44f0c 100644 (file)
@@ -23,5 +23,6 @@ echo '<div class="mtm">';
 echo elgg_view('output/url', array(
        'href' => 'admin/statistics/overview',
        'text' => elgg_echo('more'),
+       'is_trusted' => true,
 ));
 echo '</div>';