diff --git a/inc/confutils.php b/inc/confutils.php index c04d39896959936983027a5f83d4845f2b7d02b5..4a38eeaacb2ebf1b597f8d13757f09494dd0225f 100644 --- a/inc/confutils.php +++ b/inc/confutils.php @@ -88,10 +88,10 @@ function getEntities() { function getInterwiki() { static $wikis = NULL; if ( !$wikis ) { - $wikis = confToHash(DOKU_INC . 'conf/interwiki.conf'); + $wikis = confToHash(DOKU_INC . 'conf/interwiki.conf',true); } //add sepecial case 'this' - $wikis[] = 'this '.DOKU_URL.'{NAME}'; + $wikis['this'] = DOKU_URL.'{NAME}'; return $wikis; } @@ -100,7 +100,7 @@ function getInterwiki() { * * @author Harry Fuecks <hfuecks@gmail.com> */ -function confToHash($file) { +function confToHash($file,$lower=false) { $conf = array(); $lines = @file( $file ); if ( !$lines ) return $conf; @@ -112,7 +112,11 @@ function confToHash($file) { if(empty($line)) continue; $line = preg_split('/\s+/',$line,2); // Build the associative array - $conf[$line[0]] = $line[1]; + if($lower){ + $conf[strtolower($line[0])] = $line[1]; + }else{ + $conf[$line[0]] = $line[1]; + } } return $conf; diff --git a/inc/parser/handler.php b/inc/parser/handler.php index d69c2be225d9f430f25f5ed4f9fe16f2f09319d9..b1334d94690935964a5a803c762cef1751aa219d 100644 --- a/inc/parser/handler.php +++ b/inc/parser/handler.php @@ -362,22 +362,22 @@ class Doku_Handler { //decide which kind of link it is if ( preg_match('/^[a-zA-Z]+>{1}.+$/u',$link[0]) ) { - // Interwiki + // Interwiki $interwiki = preg_split('/>/u',$link[0]); $this->_addCall( 'interwikilink', array($link[0],$link[1],strtolower($interwiki[0]),$interwiki[1]), $pos ); - }elseif ( preg_match('/\\\\\\\\[\w.:?\-;,]+?\\\\/u',$link[0]) ) { - // Windows Share + }elseif ( preg_match('/\\\\\\\\[\w.:?\-;,]+?\\\\/u',$link[0]) ) { + // Windows Share $this->_addCall( 'windowssharelink', array($link[0],$link[1]), $pos ); - }elseif ( preg_match('#([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i',$link[0]) ) { - // E-Mail + }elseif ( preg_match('#([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i',$link[0]) ) { + // E-Mail $this->_addCall( 'emaillink', array($link[0],$link[1]),