From 89b92ecbb9e434619e5ca2af9ea144dca5da1bac Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Fri, 23 Jan 2015 16:02:49 +0000 Subject: [PATCH] MDL-48960 output: use nofollow attribute to stop crawling invalid links Both the calendar set url and switch theme links are displayed to non-logged in users which mean they get crawled by search bots. This prevents the search bots following these links. --- calendar/lib.php | 2 +- lib/outputrenderers.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/calendar/lib.php b/calendar/lib.php index 39704f0fb79..48829142c89 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -991,7 +991,7 @@ function calendar_filter_controls_element(moodle_url $url, $type) { $str = get_string('show'.$typeforhumans.'events', 'calendar'); } $content = html_writer::start_tag('li', array('class' => 'calendar_event')); - $content .= html_writer::start_tag('a', array('href' => $url)); + $content .= html_writer::start_tag('a', array('href' => $url, 'rel' => 'nofollow')); $content .= html_writer::tag('span', $icon, array('class' => $class)); $content .= html_writer::tag('span', $str, array('class' => 'eventname')); $content .= html_writer::end_tag('a'); diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index ca3b5c0f6a3..85cc58a44ba 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -3367,7 +3367,7 @@ EOD; $linkurl = new moodle_url('/theme/switchdevice.php', array('url' => $this->page->url, 'device' => $devicetype, 'sesskey' => sesskey())); $content = html_writer::start_tag('div', array('id' => 'theme_switch_link')); - $content .= html_writer::link($linkurl, $linktext); + $content .= html_writer::link($linkurl, $linktext, array('rel' => 'nofollow')); $content .= html_writer::end_tag('div'); return $content;