summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/pageutils.php4
-rw-r--r--inc/parser/renderer.php14
2 files changed, 5 insertions, 13 deletions
diff --git a/inc/pageutils.php b/inc/pageutils.php
index a2efdc5d5..969a6ea0d 100644
--- a/inc/pageutils.php
+++ b/inc/pageutils.php
@@ -185,10 +185,10 @@ function noNSorNS($id) {
global $conf;
$p = noNS($id);
- if ($p == $conf['start']) {
+ if ($p == $conf['start'] || $p == false) {
$p = curNS($id);
if ($p == false) {
- return noNS($id);
+ return $conf['start'];
}
}
return $p;
diff --git a/inc/parser/renderer.php b/inc/parser/renderer.php
index 4dac75d21..7e52cfce2 100644
--- a/inc/parser/renderer.php
+++ b/inc/parser/renderer.php
@@ -271,20 +271,12 @@ class Doku_Renderer extends DokuWiki_Plugin {
list($name,$hash) = explode('#',$name,2);
if($hash) return $hash;
- //trim colons or slash of a namespace link
- $name = rtrim($name,':');
- if($conf['useslash'])
- $name = rtrim($name,'/');
-
+ $name = strtr($name,';',':');
if($conf['useslash']){
- $nssep = '[:;/]';
- }else{
- $nssep = '[:;]';
+ $name = strtr($name,'/',':');
}
- $name = preg_replace('!.*'.$nssep.'!','',$name);
- if(!$name) return $this->_simpleTitle($conf['start']);
- return $name;
+ return noNSorNS($name);
}
/**