From 344763ad4e90e41c8a94b0a69a527ff2d6319ab5 Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Sat, 2 Apr 2011 03:32:13 +0100 Subject: FS#2122 alter SafeFN safe and post indicator characters. Note, any filenames encoded with the previous SafeFN scheme will need to be converted to the new scheme. Users of the old SafeFN scheme should not use this new scheme until after converting their filenames. --- inc/SafeFN.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'inc') 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 -- cgit v1.2.3 From 6a9d97936d8cb7304d0ce22ccddc0d76bc3dba85 Mon Sep 17 00:00:00 2001 From: Kate Arzamastseva Date: Thu, 7 Apr 2011 16:13:57 +0300 Subject: indexer fix updating the search index --- inc/indexer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/indexer.php b/inc/indexer.php index 0fbd939be..b42c092fa 100644 --- a/inc/indexer.php +++ b/inc/indexer.php @@ -1146,7 +1146,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; } -- cgit v1.2.3 From c006739e4780df86d205d5ebc6f39af141cbc3eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Izidor=20Matu=C5=A1ov?= Date: Sun, 20 Mar 2011 23:03:20 +0100 Subject: If the page link is empty, it should link to current page -- FS#2178 --- inc/pageutils.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'inc') 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); -- cgit v1.2.3 From fda14ffc7c57c4451df9196e8125cd39b1d5c134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Izidor=20Matu=C5=A1ov?= Date: Thu, 7 Apr 2011 19:44:54 +0200 Subject: Check if link exists and set right caption --- inc/parser/xhtml.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'inc') 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 ) { -- cgit v1.2.3