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.
This commit is contained in:
Dan Poltawski
2015-02-05 08:14:02 +00:00
parent 68b1fd2c55
commit 89b92ecbb9
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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');
+1 -1
View File
@@ -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;