Permalink
Browse files

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.
  • Loading branch information...
danpoltawski committed Jan 23, 2015
1 parent f25f4ca commit 232a79c81cd1c80afcf22947a92f5b10425d6284
Showing with 2 additions and 2 deletions.
  1. +1 −1 calendar/lib.php
  2. +1 −1 lib/outputrenderers.php
View
@@ -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');
View
@@ -3111,7 +3111,7 @@ protected function theme_switch_links() {
$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;

0 comments on commit 232a79c

Please sign in to comment.