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:
+1
-1
@@ -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');
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user