summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorMichal Rezler <rezlemic@fel.cvut.cz>2011-04-08 22:38:27 +0200
committerMichal Rezler <rezlemic@fel.cvut.cz>2011-04-08 22:38:27 +0200
commit5e8ffd73fd2a48f7a78e085ca7ed0dda73fb8af7 (patch)
tree7d6e598c52037249f707989a962e89481ca4afa2 /inc
parentff482cae0f5a620704d845037d60ae13ab851410 (diff)
parentfda14ffc7c57c4451df9196e8125cd39b1d5c134 (diff)
downloadrpg-5e8ffd73fd2a48f7a78e085ca7ed0dda73fb8af7.tar.gz
rpg-5e8ffd73fd2a48f7a78e085ca7ed0dda73fb8af7.tar.bz2
Merge branch 'master' of git://github.com/splitbrain/dokuwiki
Diffstat (limited to 'inc')
-rw-r--r--inc/SafeFN.class.php6
-rw-r--r--inc/indexer.php2
-rw-r--r--inc/pageutils.php6
-rw-r--r--inc/parser/xhtml.php9
4 files changed, 19 insertions, 4 deletions
diff --git a/inc/SafeFN.class.php b/inc/SafeFN.class.php
index ac6698a63..43b19e9ab 100644
--- a/inc/SafeFN.class.php
+++ b/inc/SafeFN.class.php
@@ -16,9 +16,9 @@
class SafeFN {
// 'safe' characters are a superset of $plain, $pre_indicator and $post_indicator
- private static $plain = '-/_0123456789abcdefghijklmnopqrstuvwxyz'; // these characters aren't converted
+ private static $plain = '-./[_0123456789abcdefghijklmnopqrstuvwxyz'; // these characters aren't converted
private static $pre_indicator = '%';
- private static $post_indicator = '.';
+ private static $post_indicator = ']';
/**
* Convert an UTF-8 string to a safe ASCII String
@@ -37,7 +37,7 @@ class SafeFN {
* - reduce codepoint value for non-printable ASCII characters (0x00 - 0x1f). Space becomes our zero.
* - convert reduced value to base36 (0-9a-z)
* - append $pre_indicator characater followed by base36 string to output, set converted flag
- * continue to next character)
+ * (continue to next character)
*
* @param string $filename a utf8 string, should only include printable characters - not 0x00-0x1f
* @return string an encoded representation of $filename using only 'safe' ASCII characters
diff --git a/inc/indexer.php b/inc/indexer.php
index 110901e58..1db966656 100644
--- a/inc/indexer.php
+++ b/inc/indexer.php
@@ -1170,7 +1170,7 @@ function idx_addPage($page, $verbose=false) {
if(@file_exists($idxtag)){
if(trim(io_readFile($idxtag)) == idx_get_version()){
$last = @filemtime($idxtag);
- if($last > @filemtime(wikiFN($ID))){
+ if($last > @filemtime(wikiFN($page))){
if ($verbose) print("Indexer: index for $page up to date".DOKU_LF);
return false;
}
diff --git a/inc/pageutils.php b/inc/pageutils.php
index cd01dcae7..c9bf60135 100644
--- a/inc/pageutils.php
+++ b/inc/pageutils.php
@@ -423,8 +423,14 @@ function resolve_mediaid($ns,&$page,&$exists){
*/
function resolve_pageid($ns,&$page,&$exists){
global $conf;
+ global $ID;
$exists = false;
+ //empty address should point to current page
+ if ($page === "") {
+ $page = $ID;
+ }
+
//keep hashlink if exists then clean both parts
if (strpos($page,'#')) {
list($page,$hash) = explode('#',$page,2);
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index 9405d9420..ab295dd01 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -574,11 +574,20 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$params = $parts[1];
}
+ // For empty $id we need to know the current $ID
+ // We need this check because _simpleTitle needs
+ // correct $id and resolve_pageid() use cleanID($id)
+ // (some things could be lost)
+ if ($id === '') {
+ $id = $ID;
+ }
+
// default name is based on $id as given
$default = $this->_simpleTitle($id);
// now first resolve and clean up the $id
resolve_pageid(getNS($ID),$id,$exists);
+
$name = $this->_getLinkTitle($name, $default, $isImage, $id, $linktype);
if ( !$isImage ) {
if ( $exists ) {