Hi all,
I think this might increase the reliability of external links in dokuwiki. Those that visit slashdot.org on a regular base will know this.
The following mod in function externallink extracts the host from the url and prints it in plain text to the right of the anchor. It shows the visitor what host it links to. This
should increase reliability:
function externallink($url, $name = NULL) {
global $conf;
$name = $this->_getLinkTitle($name, $url, $isImage);
if ( !$isImage ) {
$class='urlextern';
} else {
$class='media';
}
$ext_host = parse_url($url, PHP_URL_HOST); //edit
//prepare for formating
$link['target'] = $conf['target']['extern'];
$link['style'] = '';
$link['pre'] = '';
if($ext_host != $_SERVER['SERVER_NAME']){ //edit
$link['suf'] = ' ['.htmlspecialchars($ext_host).']'; //edit
}else{ //edit
$link['suf'] = '';
} //edit
$link['more'] = '';
$link['class'] = $class;
$link['url'] = $url;
$link['name'] = $name;
$link['title'] = $this->_xmlEntities($url);
if($conf['relnofollow']) $link['more'] .= ' rel="nofollow"';
//output formatted
$this->doc .= $this->_formatLink($link);
}