summaryrefslogtreecommitdiff
path: root/inc/html.php
diff options
context:
space:
mode:
authorAnika Henke <anika@selfthinker.org>2013-08-01 14:10:53 -0700
committerAnika Henke <anika@selfthinker.org>2013-08-01 14:10:53 -0700
commit8e3ca8dae2a45ba098e47691cf87f5b53d3442bd (patch)
treebf7453e6259af96a5dc579428aad75e77da1161d /inc/html.php
parent4fb6e51447e840624b59742bec61641d606f5006 (diff)
parentb8bc53ce8da2f0fb9cfedb01df6507b29f32daaa (diff)
downloadrpg-8e3ca8dae2a45ba098e47691cf87f5b53d3442bd.tar.gz
rpg-8e3ca8dae2a45ba098e47691cf87f5b53d3442bd.tar.bz2
Merge pull request #247 from splitbrain/FS#2766
Improve nofollow behaviour for ?do=index
Diffstat (limited to 'inc/html.php')
-rw-r--r--inc/html.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/inc/html.php b/inc/html.php
index 1bd1a74e4..614cf172c 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -854,12 +854,17 @@ function html_index($ns){
* @author Andreas Gohr <andi@splitbrain.org>
*/
function html_list_index($item){
- global $ID;
+ global $ID, $conf;
+
+ // prevent searchbots needlessly following links
+ $nofollow = ($ID != $conf['start'] || $conf['sitemap']) ? ' rel="nofollow"' : '';
+
$ret = '';
$base = ':'.$item['id'];
$base = substr($base,strrpos($base,':')+1);
if($item['type']=='d'){
- $ret .= '<a href="'.wl($ID,'idx='.rawurlencode($item['id'])).'" title="' . $item['id'] . '" class="idx_dir"><strong>';
+ // FS#2766, no need for search bots to follow namespace links in the index
+ $ret .= '<a href="'.wl($ID,'idx='.rawurlencode($item['id'])).'" title="' . $item['id'] . '" class="idx_dir"' . $nofollow . '><strong>';
$ret .= $base;
$ret .= '</strong></a>';
}else{