@@ -198,8 +198,8 @@ function search_media(&$data,$base,$file,$type,$lvl,$opts){
198
198
function search_list (&$ data ,$ base ,$ file ,$ type ,$ lvl ,$ opts ){
199
199
//we do nothing with directories
200
200
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 ' ){
203
203
//check ACL
204
204
$ id = pathID ($ file );
205
205
if (auth_quickaclcheck ($ id ) < AUTH_READ ){
@@ -220,8 +220,8 @@ function search_list(&$data,$base,$file,$type,$lvl,$opts){
220
220
function search_pagename (&$ data ,$ base ,$ file ,$ type ,$ lvl ,$ opts ){
221
221
//we do nothing with directories
222
222
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 ;
225
225
226
226
//simple stringmatching
227
227
if (!empty ($ opts ['query ' ])){
@@ -255,8 +255,8 @@ function search_allpages(&$data,$base,$file,$type,$lvl,$opts){
255
255
return true ;
256
256
}
257
257
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 ;
260
260
261
261
$ item ['id ' ] = pathID ($ file );
262
262
if (!$ opts ['skipacl ' ] && auth_quickaclcheck ($ item ['id ' ]) < AUTH_READ ){
@@ -286,8 +286,8 @@ function search_allpages(&$data,$base,$file,$type,$lvl,$opts){
286
286
function search_backlinks (&$ data ,$ base ,$ file ,$ type ,$ lvl ,$ opts ){
287
287
//we do nothing with directories
288
288
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 ;
291
291
292
292
//absolute search id
293
293
$ sid = cleanID ($ opts ['ns ' ].': ' .$ opts ['name ' ]);
@@ -333,8 +333,8 @@ function search_backlinks(&$data,$base,$file,$type,$lvl,$opts){
333
333
function search_fulltext (&$ data ,$ base ,$ file ,$ type ,$ lvl ,$ opts ){
334
334
//we do nothing with directories
335
335
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 ;
338
338
339
339
//check ACL
340
340
$ id = pathID ($ file );
@@ -400,8 +400,8 @@ function search_reference(&$data,$base,$file,$type,$lvl,$opts){
400
400
//we do nothing with directories
401
401
if ($ type == 'd ' ) return true ;
402
402
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 ;
405
405
406
406
//we finish after 'cnt' references found. The return value
407
407
//'false' will skip subdirectories to speed search up.
@@ -490,10 +490,10 @@ function sort_search_fulltext($a,$b){
490
490
* @author Andreas Gohr <[email protected] >
491
491
* @todo move to pageutils
492
492
*/
493
- function pathID ($ path ,$ keeptxt =false ){
493
+ function pathID ($ path ,$ keepxhtml =false ){
494
494
$ id = utf8_decodeFN ($ path );
495
495
$ id = str_replace ('/ ' ,': ' ,$ id );
496
- if (!$ keeptxt ) $ id = preg_replace ('#\.txt $# ' ,'' ,$ id );
496
+ if (!$ keepxhtml ) $ id = preg_replace ('#\.xhtml $# ' ,'' ,$ id );
497
497
$ id = trim ($ id , ': ' );
498
498
return $ id ;
499
499
}
@@ -508,7 +508,7 @@ function pathID($path,$keeptxt=false){
508
508
* array, where the following settings can be used.
509
509
*
510
510
* depth int recursion depth. 0 for unlimited
511
- * keeptxt bool keep .txt extension for IDs
511
+ * keepxhtml bool keep .xhtml extension for IDs
512
512
* listfiles bool include files in listing
513
513
* listdirs bool include namespaces in listing
514
514
* pagesonly bool restrict files to pages
@@ -532,7 +532,7 @@ function search_universal(&$data,$base,$file,$type,$lvl,$opts){
532
532
$ return = true ;
533
533
534
534
// 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 ' ]));
536
536
if ($ item ['id ' ] != cleanID ($ item ['id ' ])){
537
537
if ($ opts ['showmsg ' ])
538
538
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){
577
577
}else {
578
578
if (!$ opts ['listfiles ' ]) return $ return ;
579
579
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 ;
581
581
if (!$ opts ['showhidden ' ] && isHiddenPage ($ item ['id ' ])) return $ return ;
582
582
if ($ opts ['filematch ' ] && !preg_match ('/ ' .$ opts ['filematch ' ].'/ ' ,$ file )) return $ return ;
583
583
if ($ opts ['idmatch ' ] && !preg_match ('/ ' .$ opts ['idmatch ' ].'/ ' ,$ item ['id ' ])) return $ return ;
0 commit comments