Skip to content

Commit bdf58f4

Browse files
committed
txt -> xhtml
1 parent 58ec8fa commit bdf58f4

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

bin/wantedpages.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function dw_dir_filter($entry, $basepath) {
4141
}
4242
return DW_DIR_NS;
4343
}
44-
if ( preg_match('/\.txt$/',$entry) ) {
44+
if ( preg_match('/\.xhtml$/',$entry) ) {
4545
return DW_DIR_PAGE;
4646
}
4747
return DW_DIR_CONTINUE;

inc/pageutils.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,9 @@ function wikiFN($raw_id,$rev='',$clean=true){
261261
if ($clean) $id = cleanID($id);
262262
$id = str_replace(':','/',$id);
263263
if(empty($rev)){
264-
$fn = $conf['datadir'].'/'.utf8_encodeFN($id).'.txt';
264+
$fn = $conf['datadir'].'/'.utf8_encodeFN($id).'.xhtml';
265265
}else{
266-
$fn = $conf['olddir'].'/'.utf8_encodeFN($id).'.'.$rev.'.txt';
266+
$fn = $conf['olddir'].'/'.utf8_encodeFN($id).'.'.$rev.'.xhtml';
267267
if($conf['compression']){
268268
//test for extensions here, we want to read both compressions
269269
if (@file_exists($fn . '.gz')){

inc/parserutils.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ function p_wiki_xhtml($id, $rev='', $excuse=true){
6767

6868
if($rev){
6969
if(@file_exists($file)){
70-
$ret = p_render('xhtml',p_get_instructions(io_readWikiPage($file,$id,$rev)),$info); //no caching on old revisions
70+
$ret = io_readWikiPage($file,$id,$rev);
7171
}elseif($excuse){
7272
$ret = p_locale_xhtml('norev');
7373
}
7474
}else{
7575
if(@file_exists($file)){
76-
$ret = p_cached_output($file,'xhtml',$id);
76+
$ret = io_readWikiPage($file,$id);
7777
}elseif($excuse){
7878
$ret = p_locale_xhtml('newpage');
7979
}

inc/search.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ function search_media(&$data,$base,$file,$type,$lvl,$opts){
198198
function search_list(&$data,$base,$file,$type,$lvl,$opts){
199199
//we do nothing with directories
200200
if($type == 'd') return false;
201-
//only search txt files
202-
if(substr($file,-4) == '.txt'){
201+
//only search xhtml files
202+
if(substr($file,-5) == '.xhtml'){
203203
//check ACL
204204
$id = pathID($file);
205205
if(auth_quickaclcheck($id) < AUTH_READ){
@@ -220,8 +220,8 @@ function search_list(&$data,$base,$file,$type,$lvl,$opts){
220220
function search_pagename(&$data,$base,$file,$type,$lvl,$opts){
221221
//we do nothing with directories
222222
if($type == 'd') return true;
223-
//only search txt files
224-
if(substr($file,-4) != '.txt') return true;
223+
//only search xhtml files
224+
if(substr($file,-5) != '.xhtml') return true;
225225

226226
//simple stringmatching
227227
if (!empty($opts['query'])){
@@ -255,8 +255,8 @@ function search_allpages(&$data,$base,$file,$type,$lvl,$opts){
255255
return true;
256256
}
257257

258-
//only search txt files
259-
if(substr($file,-4) != '.txt') return true;
258+
//only search xhtml files
259+
if(substr($file,-5) != '.xhtml') return true;
260260

261261
$item['id'] = pathID($file);
262262
if(!$opts['skipacl'] && auth_quickaclcheck($item['id']) < AUTH_READ){
@@ -286,8 +286,8 @@ function search_allpages(&$data,$base,$file,$type,$lvl,$opts){
286286
function search_backlinks(&$data,$base,$file,$type,$lvl,$opts){
287287
//we do nothing with directories
288288
if($type == 'd') return true;
289-
//only search txt files
290-
if(substr($file,-4) != '.txt') return true;
289+
//only search xhtml files
290+
if(substr($file,-5) != '.xhtml') return true;
291291

292292
//absolute search id
293293
$sid = cleanID($opts['ns'].':'.$opts['name']);
@@ -333,8 +333,8 @@ function search_backlinks(&$data,$base,$file,$type,$lvl,$opts){
333333
function search_fulltext(&$data,$base,$file,$type,$lvl,$opts){
334334
//we do nothing with directories
335335
if($type == 'd') return true;
336-
//only search txt files
337-
if(substr($file,-4) != '.txt') return true;
336+
//only search xhtml files
337+
if(substr($file,-5) != '.xhtml') return true;
338338

339339
//check ACL
340340
$id = pathID($file);
@@ -400,8 +400,8 @@ function search_reference(&$data,$base,$file,$type,$lvl,$opts){
400400
//we do nothing with directories
401401
if($type == 'd') return true;
402402

403-
//only search txt files
404-
if(substr($file,-4) != '.txt') return true;
403+
//only search xhtml files
404+
if(substr($file,-5) != '.xhtml') return true;
405405

406406
//we finish after 'cnt' references found. The return value
407407
//'false' will skip subdirectories to speed search up.
@@ -490,10 +490,10 @@ function sort_search_fulltext($a,$b){
490490
* @author Andreas Gohr <[email protected]>
491491
* @todo move to pageutils
492492
*/
493-
function pathID($path,$keeptxt=false){
493+
function pathID($path,$keepxhtml=false){
494494
$id = utf8_decodeFN($path);
495495
$id = str_replace('/',':',$id);
496-
if(!$keeptxt) $id = preg_replace('#\.txt$#','',$id);
496+
if(!$keepxhtml) $id = preg_replace('#\.xhtml$#','',$id);
497497
$id = trim($id, ':');
498498
return $id;
499499
}
@@ -508,7 +508,7 @@ function pathID($path,$keeptxt=false){
508508
* array, where the following settings can be used.
509509
*
510510
* depth int recursion depth. 0 for unlimited
511-
* keeptxt bool keep .txt extension for IDs
511+
* keepxhtml bool keep .xhtml extension for IDs
512512
* listfiles bool include files in listing
513513
* listdirs bool include namespaces in listing
514514
* pagesonly bool restrict files to pages
@@ -532,7 +532,7 @@ function search_universal(&$data,$base,$file,$type,$lvl,$opts){
532532
$return = true;
533533

534534
// get ID and check if it is a valid one
535-
$item['id'] = pathID($file,($type == 'd' || $opts['keeptxt']));
535+
$item['id'] = pathID($file,($type == 'd' || $opts['keepxhtml']));
536536
if($item['id'] != cleanID($item['id'])){
537537
if($opts['showmsg'])
538538
msg(hsc($item['id']).' is not a valid file name for DokuWiki - skipped',-1);
@@ -577,7 +577,7 @@ function search_universal(&$data,$base,$file,$type,$lvl,$opts){
577577
}else{
578578
if(!$opts['listfiles']) return $return;
579579
if(!$opts['skipacl'] && $item['perm'] < AUTH_READ) return $return;
580-
if($opts['pagesonly'] && (substr($file,-4) != '.txt')) return $return;
580+
if($opts['pagesonly'] && (substr($file,-5) != '.xhtml')) return $return;
581581
if(!$opts['showhidden'] && isHiddenPage($item['id'])) return $return;
582582
if($opts['filematch'] && !preg_match('/'.$opts['filematch'].'/',$file)) return $return;
583583
if($opts['idmatch'] && !preg_match('/'.$opts['idmatch'].'/',$item['id'])) return $return;

0 commit comments

Comments
 (0)