summaryrefslogtreecommitdiff
path: root/inc/parser
diff options
context:
space:
mode:
authorGerrit Uitslag <klapinklapin@gmail.com>2014-02-15 11:11:15 +0100
committerGerrit Uitslag <klapinklapin@gmail.com>2014-02-15 11:11:15 +0100
commit2345e871e407dbece52f3181cd8b077f07cbb0c1 (patch)
tree96d4227cd8763a2147aed5cdf73d7cdbc1220d4d /inc/parser
parent2d6df7955d82d34f7a58b289fa04755c5ab9146e (diff)
downloadrpg-2345e871e407dbece52f3181cd8b077f07cbb0c1.tar.gz
rpg-2345e871e407dbece52f3181cd8b077f07cbb0c1.tar.bz2
wikilink creating refactored to _resolveinterwiki().
Added DOKU_BASE for local target
Diffstat (limited to 'inc/parser')
-rw-r--r--inc/parser/renderer.php5
-rw-r--r--inc/parser/xhtml.php8
2 files changed, 6 insertions, 7 deletions
diff --git a/inc/parser/renderer.php b/inc/parser/renderer.php
index e3401fd48..66a106b11 100644
--- a/inc/parser/renderer.php
+++ b/inc/parser/renderer.php
@@ -321,6 +321,11 @@ class Doku_Renderer extends DokuWiki_Plugin {
//default
$url = $url.rawurlencode($reference);
}
+ //url without slashes is handled as a pageid
+ if(strpos($url,'/') === false) {
+ list($url, $urlparam) = explode('?', $url, 2);
+ $url = wl($url, $urlparam);
+ }
if($hash) $url .= '#'.rawurlencode($hash);
return $url;
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index 957dd992b..f0a507721 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -699,12 +699,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
//get interwiki URL
$url = $this->_resolveInterWiki($wikiName,$wikiUri);
- if(strpos($url,'/') === false) {
- list($url, $urlparam) = explode('?', $url, 2);
- $url = wl($url, $urlparam);
- $link['target'] = $conf['target']['wiki'];
- }
-
if ( !$isImage ) {
$class = preg_replace('/[^_\-a-z0-9]+/i','_',$wikiName);
$link['class'] = "interwiki iw_$class";
@@ -713,7 +707,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
//do we stay at the same server? Use local target
- if( strpos($url,DOKU_URL) === 0 ){
+ if( strpos($url,DOKU_URL) === 0 OR strpos($url,DOKU_BASE) === 0){
$link['target'] = $conf['target']['wiki'];
}